0% found this document useful (0 votes)
11 views3 pages

Veterinaria Bdprueba

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Veterinaria Bdprueba

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Enter password: ****

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


Your MySQL connection id is 20
Server version: 5.1.34-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE VETERINARIA;


Query OK, 1 row affected (0.00 sec)

mysql> CREATE DATABASE DBPRUEBA;


Query OK, 1 row affected (0.00 sec)

mysql> USE VETERINARIA;


Database changed
mysql> SHOW DATABASES;
+---------------------+
| Database |
+---------------------+
| information_schema |
| abarrotes1 |
| dbprueba |
| escuela |
| mysql |
| operaciones_basicas |
| producto1 |
| test |
| veterinaria |
+---------------------+
9 rows in set (0.00 sec)

mysql> CREATE TABLE ANIMAL(ID INT(6) NOT NULL AUTO_INCREMENT, NOMBRE TEXT(20) NOT
NULL, EDAD INT(2), RAZA VARCHAR(20), PRECIO INT(7), PRIMARY KEY(ID) )TYPE=INNODB;
Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> CREATE TABLE SUCURSAL(ID INT(6) NOT NULL AUTO_INCREMENT, NOMBRE TEXT(20) NOT
NULL, TELEFONO INT(10), COLONIA VARCHAR(20), PRIMARY KEY(ID) )TYPE=INNODB;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> CREATE TABLE PERSONAL(ID INT(6) NOT NULL AUTO_INCREMENT, NOMBRE_EMPLEADO


TEXT(30) NOT NULL, TELEFONO INT(10), DIRECCION VARCHAR(20), DEPARTAMENTO
VARCHAR(30), PRIMARY KEY(ID) )TYPE=INNODB;
Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> SHOW TABLES;


+-----------------------+
| Tables_in_veterinaria |
+-----------------------+
| animal |
| personal |
| sucursal |
+-----------------------+
3 rows in set (0.00 sec)

mysql> insert into animal(nombre, edad, raza, precio)


values(‘pepe’,’2’,’americano’,’2000’);
Query OK, 1 row affected (0.01 sec)

mysql> insert into sucursal(nombre, telefono, colonia)


values(‘ARAGON’,’51479200’,’VILLA DE ARAGON’);
Query OK, 1 row affected (0.00 sec)

mysql> insert into personal(nombre_empleado, telefono, direccion,


departamento)values(‘LAURA GOMEZ‘,‘56581111‘,‘ITGAM 414‘,‘VENTAS‘);
Query OK, 1 row affected (0.01 sec)

mysql> DESCRIBE ANIMAl;


+--------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+----------------+
| ID | int(6) | NO | PRI | NULL | auto_increment |
| NOMBRE | tinytext | NO | | NULL | |
| EDAD | int(2) | YES | | NULL | |
| RAZA | varchar(20) | YES | | NULL | |
| PRECIO | int(7) | YES | | NULL | |
+--------+-------------+------+-----+---------+----------------+
5 rows in set (0.01 sec)

mysql> DESCRIBE SUCURSAL;


+----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+----------------+
| ID | int(6) | NO | PRI | NULL | auto_increment |
| NOMBRE | tinytext | NO | | NULL | |
| TELEFONO | int(10) | YES | | NULL | |
| COLONIA | varchar(20) | YES | | NULL | |
+----------+-------------+------+-----+---------+----------------+
4 rows in set (0.03 sec)

mysql> DESCRIBE PERSONAL;


+-----------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+----------------+
| ID | int(6) | NO | PRI | NULL | auto_increment |
| NOMBRE_EMPLEADO | tinytext | NO | | NULL | |
| TELEFONO | int(10) | YES | | NULL | |
| DIRECCION | varchar(20) | YES | | NULL | |
| DEPARTAMENTO | varchar(30) | YES | | NULL | |
+-----------------+-------------+------+-----+---------+----------------+
5 rows in set (0.01 sec)

mysql> SELECT * FROM ANIMAL;


+----+--------+------+-----------+--------+
| ID | NOMBRE | EDAD | RAZA | PRECIO |
+----+--------+------+-----------+--------+
| 1 | pepe | 2 | americano | 2000 |
+----+--------+------+-----------+--------+
1 row in set (0.00 sec)

mysql> SELECT*FROM SUCURSAL;


+----+--------+----------+-----------------+
| ID | NOMBRE | TELEFONO | COLONIA |
+----+--------+----------+-----------------+
| 1 | ARAGON | 51479200 | VILLA DE ARAGON |
+----+--------+----------+-----------------+
1 row in set (0.00 sec)
mysql> SELECT*FROM PERSONAL;
+----+-----------------+----------+-----------+--------------+
| ID | NOMBRE_EMPLEADO | TELEFONO | DIRECCION | DEPARTAMENTO |
+----+-----------------+----------+-----------+--------------+
| 1 | LAURA GOMEZ | 56581111 | ITGAM 414 | VENTAS |
+----+-----------------+----------+-----------+--------------+
1 row in set (0.00 sec)

mysql>

You might also like