ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Server Version


Enviado por   •  29 de Octubre de 2012  •  Informes  •  770 Palabras (4 Páginas)  •  335 Visitas

Página 1 de 4

Enter password: ******

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.0.45-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database h;

Query OK, 1 row affected (0.03 sec)

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| h |

| mysql |

| phpmyadmin |

| test |

+--------------------+

5 rows in set (0.02 sec)

mysql> use h;

Database changed

mysql> CREATE TABLE PRODUCTO(ID_PRO INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NOMBRE VARCHAR(30),PRECIO_UNIDAD INT);

Query OK, 0 rows affected (0.03 sec)

mysql> drop table PRODUCTO;

Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TABLE PRODUCTO( ID_PRO INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NOMBRE VARCHAR(30), PRECIO_UNIDAD INT);

Query OK, 0 rows affected (0.03 sec)

mysql> CREATE TABLE DETALLE_PEDIDO(ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, ID_PRODUCTO INT, FOREIGN KEY(ID_PRODUCTO) REFERENCES PRODUCTO(ID), PRECIO_UNI INT, FOREIGN KEY (PRECIO_UNI) REFERENCES PRODUCTO (PRECIO_UNIDAD), DESCUENTO DECIMAL(10,2));

Query OK, 0 rows affected (0.03 sec)

mysql> SHOW TABLES;

+----------------+

| Tables_in_h |

+----------------+

| detalle_pedido |

| producto |

+----------------+

2 rows in set (0.00 sec)

mysql> INSERT INTO PRODUCTO VALUES( NULL, 'MANTEQUILLA',31);

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO PRODUCTO VALUES( NULL, 'ARROZ',60);

Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO PRODUCTO VALUES( NULL, 'FRIJOL',20);

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO PRODUCTO VALUES( NULL, 'MAYONESA',10);

Query OK, 1 row affected (0.00 sec)

mysql>

...

Descargar como (para miembros actualizados)  txt (3.8 Kb)  
Leer 3 páginas más »
Disponible sólo en Clubensayos.com