trabajofinal

Page 1

Universidad tecnológica de Tecamachalco Base de datos Lic. María de los Ángeles Villafañe ríos Elizabeth Martínez Baltasar Marisol cruz rojas 2D


INTRODUCCION: Rellenamos las tablas con informaci贸n real y nos damos cuenta de que esto lo podemos utilizar para almacenar informaci贸n que podemos utilizar en la vida cotidiana por eso es importante conocer muy bien este programa. Cambiamos los nombres de algunas tablas las rellenamos, modificar datos Visualizar varias tablas, a帽adir m谩s registros.


1.- A continuaci贸n se describen los datos a insertar en la Base de Datos Toreros, una vez ingresados los datos mostrar todos los registros de cada una de las tablas. Microsoft Windows XP [Versi贸n 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\M@risol_VAIO>cd ? C:\Documents and Settings\M@risol_VAIO>\cd\ "\cd\" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable. C:\Documents and Settings\M@risol_VAIO>cd \ C:\>cd xampp C:\xampp>cd mysql C:\xampp\mysql>cd bin C:\xampp\mysql\bin>mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.41 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use corridas


Database changed mysql> DESCRIBE PLAZADETOROS; +-----------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+----------+------+-----+---------+-------+ | Nombre | char(20) | NO | PRI | NULL | | | localidad | char(20) | NO | | NULL | | | direccion | char(20) | NO | | NULL | | | aforo | char(20) | NO | | NULL | | +-----------+----------+------+-----+---------+-------+ 4 rows in set (0.34 sec)

Se utilzo el comando describe para ver la estructura de la tabla plaza de toros mysql> insert into plazadetoros (nombre,localidad,direccion,aforo,) values("El relicario","Puebla","Recinto Ferial","5000"); Query OK, 1 row affected (0.06 sec)

Se utiliz贸 el comando insert into para ingresar registros en la tabla de plaza de toros mysql> insert into plazadetoros (nombre,localidad,direccion,aforo) values("Plaza de toros Mexico","Distrito Federal","Mexico, DF","41000"); Query OK, 1 row affected (0.00 sec) mysql> insert into plazadetoros (nombre,localidad,direccion,aforo,) values("Plaza Monumental de Apizaco","Apizaco","Tlaxcala","7000"); Query OK, 1 row affected (0.00 sec)


mysql> select * from plazadetoros; +-----------------------------+------------------+----------------+-------+----| nombre | localidad | direccion | aforo | +-----------------------------+------------------+----------------+-------+----| El relicario | Puebla | Recinto Ferial | 5000 | | Plaza de toros Mexico | Distrito Federal | Mexico, DF | 41000 | | Plaza Monumental de Apizaco | Apizaco | Tlaxcala | 7000 | +-----------------------------+------------------+----------------+-------+-----

Se utilzo el comando select * from para revisar los datos ya ingresados. 3 rows in set (0.08 sec) mysql> DESCRIBE GANADERIA; +----------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+----------+------+-----+---------+-------+ | CODIGO | char(20) | NO | PRI | NULL | | | NOMBRE | char(20) | NO | | NULL | | | LOCALIDAD | char(20) | NO | | NULL | | | FECHA_CREACION | char(20) | NO | | NULL | | +----------------+----------+------+-----+---------+-------+ 4 rows in set (0.13 sec) mysql> insert into ganaderia (codigo,nombre,localidad,fecha_creacion) values("G1","La laguna","Tlaxcala","1907"); Query OK, 1 row affected (0.00 sec) mysql> insert into ganaderia (codigo,nombre,localidad,fecha_creacion) values("G2","San Mateo","Zacateca","1906");


Query OK, 1 row affected (0.00 sec) mysql> insert into ganaderia (codigo,nombre,localidad,fecha_creacion) values("G3","Reyes Huerta","Tlaxcala","1904"); Query OK, 1 row affected (0.00 sec) mysql> select * from ganaderia; +--------+--------------+----------------------------------------------+----------+-----------------+ | codigo | nombre | localidad | fecha_creacion |+---| G1 | La laguna | Tlaxcala | 1907 | | G2 | San Mateo | Zacateca | 1906 | | G3 | Reyes Huerta | Tlaxcala | 1904 | +--------+--------------+----------------------------------------------+----------+-----------------+ 3 rows in set (0.28 sec) mysql> describe corrida; +--------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+----------+------+-----+---------+-------+ | ORDEN | char(20) | NO | PRI | NULL | | | FERIA | char(20) | NO | | NULL | | | ANO | char(20) | NO | | NULL | | | nombre | char(20) | YES | MUL | NULL | | +--------+----------+------+-----+---------+-------+ 4 rows in set (0.13 sec)


mysql> insert into corrida (Orden,Feria,Ano,nombre) values("001","Tlaxcala","2010","Plaza Monumental de Apizaco"); Query OK, 1 row affected (0.28 sec) mysql> insert into corrida (Orden,Feria,Ano,nombre) values("002","San Nicolas","2009","Plaza Monumental de Apizaco"); Query OK, 1 row affected (0.28 sec) mysql> insert into corrida (Orden,Feria,Ano,nombre) values("003","Mayo","2010","El relicario"); Query OK, 1 row affected (0.00 sec) mysql> insert into corrida (Orden,Feria,Ano,nombre) values("004","Mayo","2011","El relicario"); Query OK, 1 row affected (0.00 sec) mysql> insert into corrida (Orden,Feria,Ano,nombre) values("005","Vive Mexico","2010","Plaza de toros Mexico"); Query OK, 1 row affected (0.00 sec) mysql> select * from corrida; +---------------+------------------------+--------------------+----------------------------+ | Orden | Feria | Ano | nombre--------------------------------------+ | 001 | Tlaxcala | 2010 | Plaza Monumental de Apizaco | | 002 | San Nicolas | 2009 | Plaza Monumental de Apizaco |


| 003 | Mayo | 2010 | El relicario | | 004 | Mayo | 2011 | El relicario | | 005 | Vive Mexico | 2010 | Plaza de toros M exico | +---------------+------------------------+--------------------+----------------------------+ 5 rows in set (0.13 sec) mysql> describe apoderado; +-----------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+----------+------+-----+---------+-------+ | DNIA | char(20) | NO | PRI | | | | NOMBRE | char(20) | NO | | NULL | | | DIRECCION | char(20) | NO | | NULL | | | TELEFONO | char(20) | NO | | NULL | | +-----------+----------+------+-----+---------+-------+ 4 rows in set (0.34 sec) mysql> insert into apoderado (DNIA,NOMBRE,DIRECCION,telefono) values("2001","Jose Antonio","Puebla","2222086978"); Query OK, 1 row affected (0.00 sec) mysql> insert into apoderado (DNIA,NOMBRE,DIRECCION,telefono) values("2002","Miguel Alejandro","Mexico","5555123223"); Query OK, 1 row affected (0.00 sec)


mysql> insert into apoderado (DNIA,NOMBRE,DIRECCION,telefono) values("2003","Jose Ignacio","Tlaxcala","2234674511"); Query OK, 1 row affected (0.00 sec) mysql> select * from apoderado; +------+------------------+----------+-----------+--------------+------+ | DNIA | NOMBRE | DIRECCION | telefono | DNI1 | +------+------------------+----------+-----------+--------------+------+ | 2001 | Jose Antonio | Puebla | 2222086978 | 2001 | | 2002 | Miguel Alejandro | Mexico | 5555123223 | 2002 | | 2003 | Jose Ignacio | Tlaxcala | 2234674511 | 2003 | +------+------------------+----------+-----------+--------------+------+ 3 rows in set (0.13 sec) mysql> DESCRIBE TOREROS; +-------------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------+----------+------+-----+---------+-------+ | DNIT | char(20) | NO | PRI | NULL | | | NOMBRE | char(20) | NO | | NULL | | | APODO | char(20) | NO | | NULL | | | FECHA_ALTERNATIVA | char(20) | NO | | NULL | | | DNIT1 | char(20) | YES | MUL | NULL | | | DNIA | char(20) | YES | MUL | NULL | | +-------------------+----------+------+-----+---------+-------+ 6 rows in set (0.33 sec)


mysql> insert into TOREROS (DNIT,NOMBRE,APODO,FECHA_ALTERNATIVA,DNIT1,DNIA) values("1001","Jose Rubio","El Joselito","20-12-1978","Vacio","2003"); Query OK, 1 row affected (0.00 sec) mysql> insert into TOREROS (DNIT,NOMBRE,APODO,FECHA_ALTERNATIVA,DNIT1,DNIA) values("1002","Daniel Sotomayor","El Sotoluco","12-01-1985","1001","2003"); Query OK, 1 row affected (0.00 sec) mysql> insert into TOREROS (DNIT,NOMBRE,APODO,FECHA_ALTERNATIVA,DNIT1,DNIA) values("1003",”Carlos Aurelio","El Yeyo","02-07-1990","1001","2002"); Query OK, 1 row affected (0.00 sec) mysql> insert into TOREROS (DNIT,NOMBRE,APODO,FECHA_ALTERNATIVA,DNIT1,DNIA) values("1004",”Alfredo","El cuñado","01-03-1992","1003","2001"); Query OK, 1 row affected (0.00 sec) mysql> select * from toreros; +------+------------------+-------------+------------------------+------------------+-------+ | DNIT | NOMBRE | APODO | FECHA_ALTERNATIVA | DNIT1 | DNIA | +------+------------------+-------------+------------------------+-------------| 1001 | Jose Rubio | El Joselito | 20-12-1978 |vacio | 2003 | | 1002 | Daniel Sotomayor | El Sotoluco | 12-01-1985 | 1001 | 2003 | | 1003 | Carlos Aurelio | El Yeyo | 02-07-1990 | 1002 | 2003 | | 1004 | Alfredo | El cuñado | 02-07-1990 | 1003 | 2003 | +------+------------------+-------------+------------------------+-------------4 rows in set (0.00 sec) mysql> describe toros; +-----------+----------+------+-----+---------+-------+


| Field | Type | Null | Key | Default | Extra | +-----------+----------+------+-----+---------+-------+ | No | char(20) | NO | PRI | NULL | | | NOMBRE | char(20) | NO | | NULL | | | COLOR | char(20) | NO | | NULL | | | Ano_nacio | char(20) | NO | | NULL | | | ORDEN | char(20) | YES | MUL | NULL | | | CODIGO | char(20) | NO | MUL | NULL | | +-----------+----------+------+-----+---------+-------+ 6 rows in set (0.03 sec) mysql> mysql> insert into toros (No,NOMBRE,COLOR,Ano_nacio,CODIGO,ORDEN) values("1","el pajarito","negro","1999"," G3","005"); Query OK, 1 row affected (0.00 sec) mysql> insert into toros (No,NOMBRE,COLOR,Ano_nacio, CODIGO,ORDEN) values("2","Atrevido","pinto","1998"," G1","005"); Query OK, 1 row affected (0.00 sec) mysql> insert into toros (No,NOMBRE,COLOR,Ano_nacio, CODIGO,ORDEN) values("3","Valedor","negro","1999"," G2","001"); Query OK, 1 row affected (0.00 sec) mysql> insert into toros (No,NOMBRE,COLOR,Ano_nacio, CODIGO,ORDEN) values("4","Navegante","Pinto","1998"," G2","004"); Query OK, 1 row affected (0.00 sec)


mysql> insert into toros (No,NOMBRE,COLOR,Ano_nacio, CODIGO,ORDEN) values("5","Islero","negro","1999"," G1","002"); Query OK, 1 row affected (0.00 sec) mysql> insert into toros (No,NOMBRE,COLOR,Ano_nacio, CODIGO,ORDEN) values("6","cabatisto","pinto","1999"," G3","003"); Query OK, 1 row affected (0.00 sec) mysql> insert into toros (No,NOMBRE,COLOR,Ano_nacio, CODIGO,ORDEN) values("7","jabonero","pinto","1998"," G2","004"); Query OK, 1 row affected (0.00 sec) mysql> select * from toros; +---------------+-------------+-------+-------------------+-------------------+---------------------+---------------+--------+ | No | NOMBRE | COLOR | Ano_nacio | CODIGO|ORDEN | +---------------+-------------+-------+-------------------+-------------------+| 1 | el pajarito | negro | 1999 | G3 | 005 | | 2 | atrevido | pinto | 1998 | G1 | 005 | | | 3 | valedor | negro | 1999 | G2 | 001 | | 4 | navegante | pinto | 1998 | G2 | 004 || | 5 | islero | negro | 1999 | G1 | 002 || | 6 | cabatisto | pinto | 1999 | G3 | 003 || | 7 | jabonero | pinto | 1998 | G2 | 004 | | +---------------+-------------+-------+-------------------+-------------------+---------------------+---------------+--------+ 7 rows in set (0.02 sec) mysql> describe premio;


+--------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+----------+------+-----+---------+-------+ | No. Premio | int(11) | NO | PRI | 0 | | | orejas | char(10) | NO | | NULL | | | rabos | char(10) | NO | | NULL | | | Puerta_grande | char(4) | YES | | NULL | | | DNIT | char(10) | YES | MUL | NULL | | +--------------+----------+------+-----+---------+-------+ 5 rows in set (0.27 sec) mysql> insert into premio (No.premio,orejas,rabos,Puerta_grande,DNIT) va lues("3178","1","0","no","1001"); Query OK, 1 row affected (0.08 sec) mysql> insert into premio (No.premio,orejas,rabos,Puerta_grande,DNIT) va lues("3145","4","2","si","1002"); Query OK, 1 row affected (0.00 sec) mysql> insert into premio (No.premio,orejas,rabos,Puerta_grande,DNIT) va lues("3122","2","1","si","1003"); Query OK, 1 row affected (0.00 sec) mysql> insert into premio (No.premio,orejas,rabos,Puerta_grande,DNIT) va lues("3131","1","0","no","1004"); Query OK, 1 row affected (0.00 sec) mysql> select * from premio;


+--------+----------------+---------------+-----------+------+ | No.premio| orejas | rabos | Puerta_grande | DNIT | +--------+----------------+---------------+-----------+------+ | 3178 | 1 | 0 | no | 1001 | | 3145 | 4 | 2 | si | 1002 | | 3122 | 2 | 1 | si | 1003 | | 3131 | 1 | 0 | no | 1004 | +--------+----------------+---------------+-----------+------+ 4 rows in set (0.00 sec) mysql> describe actuar; +-------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+-------+ | ORDEN | char(20) | NO | PRI | NULL | | | DNIT | char(20) | NO | PRI | NULL | | +-------+----------+------+-----+---------+-------+ 2 rows in set (0.33 sec) mysql> insert into actuar (Orden,DNIT) values("004","1002"); Query OK, 1 row affected (0.00 sec) mysql> insert into actuar (Orden,DNIT) values("004","10002"); Query OK, 1 row affected (0.00 sec) mysql> insert into actuar (Orden,DNIT) values("001","1003"); Query OK, 1 row affected (0.00 sec)


mysql> insert into actuar (Orden,DNIT) values("005","1001"); Query OK, 1 row affected (0.00 sec) mysql> insert into actuar (Orden,DNIT) values("005","10001"); Query OK, 1 row affected (0.00 sec) mysql> insert into actuar (Orden,DNIT) values("003","1004"); Query OK, 1 row affected (0.00 sec) mysql> insert into actuar (Orden,DNIT) values("003","10004"); Query OK, 1 row affected (0.00 sec) mysql> select * from actuar; +---------------+------+ | ORDEN | DNIT | +---------------+------+ | 004 | 1002 | | 004 | 10002 | | 001 | 1003 | | 005 | 1001 | | 005 | 10001 | | 003 | 1004 | | 002 | 1001 | +---------------+------+ 5 rows in set (0.11 sec)


2.- Cambiar el nombre de la columna A単o_nacio de la tabla toros por Fecha_nacimiento mysql> alter table toros >change Ano_nacio Fecha_nacimiento char(30); Query OK, 7 rows affected (0.34 sec) Records: 7 Duplicates: 0 Warnings: 0 Se utilzo el comando alter table change sirve para cambiar el nombre de la columna a単o_nacio por fecha de nacimiento mysql> describe toros; +-----------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+----------+------+-----+---------+-------+ | No | char(20) | NO | PRI | NULL | | | NOMBRE | char(20) | NO | | NULL | | | COLOR | char(20) | NO | | NULL | | | Fecha_nacimiento | char(30) | NO | | NULL | | | ORDEN | char(20) | YES | MUL | NULL | | | CODIGO | char(20) | NO | MUL | NULL | | +-----------+----------+------+-----+---------+-------+ 6 rows in set (0.03 sec)


3.- Cambiar el nombre de la columna DNIT1 que es la llave forรกnea de la tabla toreros por Padrino. mysql> alter table toreros >change DNIT1 Padrino char(30); Query OK, 7 rows affected (0.34 sec) Records: 7 Duplicates: 0 Warnings: 0 Se utilzo el comando sirve para cambiar el nombre de la columna DNIT1 por Padrino mysql> DESCRIBE TOREROS; +-------------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------+----------+------+-----+---------+-------+ | DNIT | char(20) | NO | PRI | NULL | | | NOMBRE | char(20) | NO | | NULL | | | APODO | char(20) | NO | | NULL | | | FECHA_ALTERNATIVA | char(20) | NO | | NULL | | | PADRINO | char(30) | YES | MUL | NULL | | | DNIA | char(20) | YES | MUL | NULL | | +-------------------+----------+------+-----+---------+-------+ 6 rows in set (0.33 sec)


4.- Modificar el registro 1002 de la Tabla Toreros en el campo “Apodo” cambiar el que existe por “El Zotoluco”. mysql> UPDATE TOREROS SET APODO='ZOTOLUCO' WHERE DNIT='El sotoluco'; Query OK, 1 row affected (0.00 sec)

Se utilzo el comando sirve para Update para modificar un registro mysql> select * from toreros; +------+------------------+-------------+------------------------+------------------+-------+ | DNIT | NOMBRE | APODO | FECHA_ALTERNATIVA | DNIT1 | DNIA | +------+------------------+-------------+------------------------+-------------| 1001 | Jose Rubio | El Joselito | 20-12-1978 |vacio | 2003 | | 1002 | Daniel Sotomayor | ZOTOLUCO | 12-01-1985 | 1001 | 2003 | | 1003 | Carlos Aurelio | El Yeyo | 02-07-1990 | 1002 | 2003 | | 1004 | Carlos Aurelio | El Yeyo | 02-07-1990 | 1003 | 2003 | +------+------------------+-------------+------------------------+-------------4 rows in set (0.00 sec)


5.- Mostrar los datos de los Toreros ordenados de la A a la Z. mysql>select * from toreros order by NOMBRE; mysql> select * from toreros; +------+------------------+-------------+------------------------+------------------+-------+ | DNIT | NOMBRE | APODO | FECHA_ALTERNATIVA | DNIT1 | DNIA | +------+------------------+-------------+------------------------+-------------| 1004 | Alfredo | El cu単ado | 02-07-1990 | 1003 | 2003 | | 1003 | Carlos Aurelio | El Yeyo | 02-07-1990 | 1002 | 2003 | | 1002 | Daniel Sotomayor | El Sotoluco | 12-01-1985 | 1001 | 2003 | | 1001 | Jose Rubio | El Joselito | 20-12-1978 |vacio | 2003 | +------+------------------+-------------+------------------------+-------------4 rows in set (0.00 sec)


6.- Mostrar las corridas ordenadas por A単o. (Ordenadas descendentemente). mysql> select * from corrida order by ANO desc; mysql> select * from corrida; +---------------+------------------------+--------------------+----------------------------+ | Orden | Feria | Ano | nombre--------------------------------------+ | 004 | Mayo | 2011 | El relicario | | 001 | Tlaxcala | 2010 | Plaza Monumentalde Apizaco | | 003 | Mayo | 2010 | El relicario | | 005 | Vive Mexico | 2010 | Plaza de toros Mexico | | 002 | San Nicolas | 2009 | Plaza Monumental de Apizaco | +---------------+------------------------+--------------------+----------------------------+ 5 rows in set (0.13 sec)


7.- Cambiar el Nombre de la Tabla ActĂşan por el Nombre Participan. mysql> alter table acturar rename participan; Query OK, 0 rows affected (0.02 sec) mysql> describe participan; +-------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+-------+ | ORDEN | char(20) | NO | PRI | NULL | | | DNIT | char(20) | NO | PRI | NULL | | +-------+----------+------+-----+---------+-------+ 2 rows in set (0.33 sec)


8.- Mostrar todos los datos de las tablas Toreros y Premios considerando la siguiente condici贸n: Toreros.DNIT=Premios.DNTI


9.- Modificar el registro 7 de la tabla Toros en el campo Color cambiar Pinto por Negro mysql> UPDATE toros set color='pinto' where color='negro'; Query OK, 3 rows affected (0.01 sec) Rows matched: 3 Changed: 3 Warnings: 0 mysql> select * from toros; +---------------+-------------+-------+-------------------+-------------------+---------------------+---------------+--------+ | No | NOMBRE | COLOR | Ano_nacio | CODIGO|ORDEN | +---------------+-------------+-------+-------------------+-------------------+| 1 | el pajarito | negro | 1999 | G3 | 005 | | 2 | atrevido | pinto | 1998 | G1 | 005 | | | 3 | valedor | negro | 1999 | G2 | 001 | | 4 | navegante | pinto | 1998 | G2 | 004 || | 5 | islero | negro | 1999 | G1 | 002 || | 6 | cabatisto | pinto | 1999 | G3 | 003 || | 7 | jabonero | negro | 1998 | G2 | 004 | | +---------------+-------------+-------+-------------------+-------------------+---------------------+---------------+--------+ 7 rows in set (0.02 sec)


10.- A単adir una columna con el nombre Peso con tipo de dato Entero en la tabla de Toros e ingresar los datos de peso a cada uno de los registros. mysql>alter table toros >add peso char(30); Query OK, 1 row affected (0.00 sec) mysql> update toros set peso='500' where numero='1'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update toros set peso='450' where numero='2'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update toros set peso='487' where numero='3'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update toros set peso='460' where numero='4'; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update toros set peso='510' where numero='5'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0


mysql> update toros set peso='490' where numero='6'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update toros set peso='505' where numero='7'; Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0 mysql> select * from toros; +---------------+-------------+-------+-------------------+-------------------+| No | NOMBRE | COLOR | Ano_nacio | CODIGO|ORDEN |peso +---------------+-------------+-------+-------------------+-------------------+| 1 | el pajarito | negro | 1999 | G3 | 005 |500 | | 2 | atrevido | pinto | 1998 | G1 | 005 | 450 | | 3 | valedor | negro | 1999 | G2 | 001 |487 | | 4 | navegante | pinto | 1998 | G2 | 004 |460 | | 5 | islero | negro | 1999 | G1 | 002 |510 | | 6 | cabatisto | pinto | 1999 | G3 | 003 |490 | | 7 | jabonero | pinto | 1998 | G2 | 004 | 505 | +---------------+-------------+-------+-------------------+-------------------+---------------------+---------------+--------+


11.- Mostrar los registros de la tabla Toros ordenados por el Peso. mysql> select * from toros order by peso desc; Query OK, 0 rows affected (0.00 sec) mysql> select * from toros; +---------------+-------------+-------+-------------------+-------------------+| No | NOMBRE | COLOR | Ano_nacio | CODIGO|ORDEN |peso +---------------+-------------+-------+-------------------+-------------------+| 5 | islero | negro | 1999 | G1 | 002 |510 | | 7 | jabonero | pinto | 1998 | G2 | 004 | 505 | | 1 | el pajarito | negro | 1999 | G3 | 005 |500 | | 6 | cabatisto | pinto | 1999 | G3 | 003 |490 | | 3 | valedor | negro | 1999 | G2 | 001 |487 | | 4 | navegante | pinto | 1998 | G2 | 004 |460 | | 2 | atrevido | pinto | 1998 | G1 | 005 | 450 | +---------------+-------------+-------+-------------------+-------------------+---------------------+---------------+--------+


Conclusión En este presente trabajo mostramos todo y ponemos en práctica lo que hemos aprendido durante estos dos últimos cuatrimestres bajo con MYsql para poder realizar esta práctica exitosamente.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.