Está en la página 1de 8

4 rows in set (0.

00 sec)

mysql> select nom_profesor from profesor order by sal_prof asc limit 1;


ERROR 1054 (42S22): Unknown column 'nom_profesor' in 'field list'
mysql> select nom_prof from profesor order by sal_prof asc limit 1;
+----------+
| nom_prof |
+----------+
| maritza |
+----------+
1 row in set (0.00 sec)

mysql> select doc_est, nom_est, fec_ini_estcur, nom_curs, horas_cur from estudiante


join estudiantexcurso join curs
o on fec_ini_estcur='2011-01-02' and doc_est=doc_est_estcur and
cod_curso_estcur=cod_curso;
ERROR 1054 (42S22): Unknown column 'cod_curso_estcur' in 'on clause'
mysql> select doc_est, nom_est, fec_ini_estcur, nom_curs, horas_cur, valor_cur
-> -> from estudiante join estudiantexcurso join curso
-> -> on fec_ini_estcur = '2011-01-02'and doc_est = doc_est_estcur and
cod_curso_estcur =
-> cod_curso;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server ve
rsion for the right syntax to use near 'from estudiante join estudiantexcurso join
curso
-> on fec_ini_estcur = '2011-01' at line 2
mysql> select doc_est, nom_est, fec_ini_estcur, nom_curs, horas_cur, valor_cur
-> from estudiante join estudiantexcurso join curso
-> on fec_ini_estcur = '2011-01-02'and doc_est = doc_est_estcur and
cod_curso_estcur =
-> cod_curso;
ERROR 1054 (42S22): Unknown column 'cod_curso_estcur' in 'on clause'
mysql> select doc_est, nom_est, fec_ini_estcur, nom_curs, horas_cur from estudiante
join estudiantexcurso join curs
o on fec_ini_estcur='2011-01-02' and doc_est=doc_est_estcur and
cod_cur_estcur=cod_curs;
+---------------+---------+----------------+-----------------+-----------+
| doc_est | nom_est | fec_ini_estcur | nom_curs | horas_cur |
+---------------+---------+----------------+-----------------+-----------+
| 1.098.765.678 | carlos | 2011-01-02 | manejo de mysql | 45 |
| 1.098.098.097 | jonatan | 2011-01-02 | manejo de mysql | 45 |
+---------------+---------+----------------+-----------------+-----------+
2 rows in set (0.10 sec)

mysql> select nom_prof,ape_prof,sal_prof from profesor where sal_prof>=500000 and


sal_prof<=700000;
+----------+----------+----------+
| nom_prof | ape_prof | sal_prof |
+----------+----------+----------+
| maritza | angarita | 550000 |
| martha | rojas | 690000 |
+----------+----------+----------+
2 rows in set (0.00 sec)

mysql> select nom_cli,ape_cli,fec_ped from cliente join pedido on id_cli_ped=id_cli


and fec_ped='2012-02-25';
+----------+---------+------------+
| nom_cli | ape_cli | fec_ped |
+----------+---------+------------+
| maritza | rojas | 2012-02-25 |
| catalina | zapata | 2012-02-25 |
+----------+---------+------------+
2 rows in set (0.12 sec)

mysql> select fec_ped, tit_art, nom_cli, can_art_artped from articulo join


articuloxpedido join pedido join cliente
on id_cli_ped = id_cli and id_ped_artped = id_pedido and id_art = id_art_artped;
ERROR 1054 (42S22): Unknown column 'id_pedido' in 'on clause'
mysql> select fec_ped, tit_art, nom_cli, can_art_artped from articulo join
articuloxpedido join pedido join cliente
on id_cli_ped = id_cli and id_ped_artped = id_ped and id_art = id_art_artped;
+------------+---------------------------------------+-------------
+----------------+
| fec_ped | tit_art | nom_cli | can_art_artped
|
+------------+---------------------------------------+-------------
+----------------+
| 2012-02-25 | creacion de un portal con php y mysql | maritza | 5
|
| 2012-02-25 | administracion de sistemas operativos | maritza | 12
|
| 2012-04-30 | redes ciscos | juan carlos | 5
|
| 2011-12-10 | facebook y twitter para adultos | maritza | 10
|
| 2011-12-10 | creacion de un portal con php y mysql | maritza | 12
|
| 2012-02-25 | redes ciscos | catalina | 20
|
+------------+---------------------------------------+-------------
+----------------+
6 rows in set (0.06 sec)

mysql> select nom_cli, mes_cum_cli from cliente where mes_cum_cli = 'Marzo';


+-------------+-------------+
| nom_cli | mes_cum_cli |
+-------------+-------------+
| catalina | marzo |
| juan carlos | marzo |
+-------------+-------------+
2 rows in set (0.00 sec)

mysql> select id_ped_artped, nom_cli, dir_cli, tit_art, prec_art, can_art_artped,


val_ped from articuloxpedido join
cliente join articulo join pedido on id_cli = id_cli_ped and id_ped =
id_ped_artped and id_ped_artped = 1 and id_a
rt= id_art_artped;
ERROR 1054 (42S22): Unknown column 'dir_cli' in 'field list'
mysql> describe cliente;
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| id_cli | varchar(11) | NO | PRI | NULL | |
| nom_cli | varchar(30) | NO | | NULL | |
| ape_cli | varchar(30) | NO | | NULL | |
| dic_cli | varchar(100) | NO | | NULL | |
| dep_cli | varchar(20) | NO | | NULL | |
| mes_cum_cli | varchar(10) | NO | | NULL | |
+-------------+--------------+------+-----+---------+-------+
6 rows in set (0.05 sec)

mysql> select id_ped_artped, nom_cli, dic_cli, tit_art, prec_art, can_art_artped,


val_ped from articuloxpedido join
cliente join articulo join pedido on id_cli = id_cli_ped and id_ped =
id_ped_artped and id_ped_artped = 1 and id_a
rt= id_art_artped;
+---------------+---------+--------------------
+---------------------------------------+----------+----------------
+---------+
| id_ped_artped | nom_cli | dic_cli | tit_art
| prec_art | can_art_artped
| val_ped |
+---------------+---------+--------------------
+---------------------------------------+----------+----------------
+---------+
| 1 | maritza | calle 34 no. 14-45 | creacion de un portal con php y
mysql | 40000 | 5
| 120000 |
| 1 | maritza | calle 34 no. 14-45 | administracion de sistemas
operativos | 55000 | 12
| 120000 |
+---------------+---------+--------------------
+---------------------------------------+----------+----------------
+---------+
2 rows in set (0.07 sec)

mysql> select nom_cli, fec_ped,val_ped from cliente join pedido on id_cli =


id_cli_ped order by val_ped desc limit
1;
+----------+------------+---------+
| nom_cli | fec_ped | val_ped |
+----------+------------+---------+
| catalina | 2012-02-25 | 1800000 |
+----------+------------+---------+
1 row in set (0.00 sec)

mysql> select count(*) as id_art from articulo group by edi_art;


+--------+
| id_art |
+--------+
| 4 |
+--------+
1 row in set (0.00 sec)

mysql> select id_art_artped, tit_art, can_art_artped, val_ven_art_artped from


articuloxpedido join articulo join pe
dido on id_ped = id_ped_artped and id_art = id_art_artped;
+---------------+---------------------------------------+----------------
+--------------------+
| id_art_artped | tit_art | can_art_artped |
val_ven_art_artped |
+---------------+---------------------------------------+----------------
+--------------------+
| 3 | creacion de un portal con php y mysql | 5 |
40000 |
| 4 | administracion de sistemas operativos | 12 |
55000 |
| 1 | redes ciscos | 5 |
65000 |
| 2 | facebook y twitter para adultos | 10 |
55000 |
| 3 | creacion de un portal con php y mysql | 12 |
45000 |
| 1 | redes ciscos | 20 |
65000 |
+---------------+---------------------------------------+----------------
+--------------------+
6 rows in set (0.03 sec)

mysql> select * from cliente order by ape_cli;


+------------+-------------+---------+---------------------------------+-----------
+-------------+
| id_cli | nom_cli | ape_cli | dic_cli | dep_cli
| mes_cum_cli |
+------------+-------------+---------+---------------------------------+-----------
+-------------+
| 77191956 | juan carlos | arenas | diagonal 23 no. 12-34 apto. 101 | valle
| marzo |
| 13890234 | roger | ariza | carrera 30 no. 13-45 | antioquia
| junio |
| 63502718 | maritza | rojas | calle 34 no. 14-45 | santander
| abril |
| 1098765789 | catalina | zapata | avenida el libertador no. 30-14 | cauca
| marzo |
+------------+-------------+---------+---------------------------------+-----------
+-------------+
4 rows in set (0.00 sec)

mysql> select * from articulo order by aut_art;


+--------+---------------------------------------+----------------------
+----------------+----------+
| id_art | tit_art | aut_art | edi_art
| prec_art |
+--------+---------------------------------------+----------------------
+----------------+----------+
| 1 | redes ciscos | ernesto arigasello |
alfaomega-rama | 60000 |
| 3 | creacion de un portal con php y mysql | jacobo pavon puertas |
alfaomega-rama | 40000 |
| 4 | administracion de sistemas operativos | julio gomez lopez |
alfaomega-rama | 55000 |
| 2 | facebook y twitter para adultos | veloso claudio |
alfaomega-rama | 52000 |
+--------+---------------------------------------+----------------------
+----------------+----------+
4 rows in set (0.00 sec)

mysql> select id_art_artped, nom_cli, dic_cli, can_art_artped from articuloxpedido


join cliente join pedido join ar
ticulo on id_art = id_art_artped and id_art_artped = 2 group by id_art;
+---------------+----------+---------------------------------+----------------+
| id_art_artped | nom_cli | dic_cli | can_art_artped |
+---------------+----------+---------------------------------+----------------+
| 2 | catalina | avenida el libertador no. 30-14 | 10 |
+---------------+----------+---------------------------------+----------------+
1 row in set (0.13 sec)

mysql> select * from compa�ia where coma�ofun >= 1991 and coma�ofun <= 1998;
+-------------+-------------------+------------+---------------------+
| comnit | comnombre | coma�ofun | comreplegal |
+-------------+-------------------+------------+---------------------+
| 800890890-2 | seguros atlantida | 1998 | carlos lopez |
| 899999999-1 | seguradora rojas | 1991 | luis fernando rojas |
+-------------+-------------------+------------+---------------------+
2 rows in set (0.01 sec)

mysql> select autoplaca, automarca, autotipo, automodelo, autonumpasajeros,


autocilindraje,autonumchasis, asefechae
xpiracion from automotores join aseguramientos on autoplaca = aseplaca and
asefechaexpiracion > '2013-10-01' and as
efechaexpiracion < '2013-10-31';
Empty set (0.01 sec)

mysql> select asecodigo, asefechainicio, asecosto, asevalorasegurado, incicodigo,


incifecha,inciplaca, incilugar, i
ncicantheridos, incicantfatalidades, incicanautosinvolucrados from aseguramientos
join incidentes on incifecha = '2
012-09-30'group by incifecha;
ERROR 1054 (42S22): Unknown column 'incicantfatalidades' in 'field list'
mysql> select asecodigo, asefechainicio, asecosto, asevalorasegurado, incicodigo,
incifecha,inciplaca, incilugar, i
ncicantheridos, incicanfatalidades, incicanautosinvolucrados from aseguramientos
join incidentes on incifecha = '20
12-09-30'group by incifecha;
+-----------+----------------+----------+-------------------+------------
+------------+-----------+-------------+--
---------------+--------------------+--------------------------+
| asecodigo | asefechainicio | asecosto | asevalorasegurado | incicodigo |
incifecha | inciplaca | incilugar | i
ncicantheridos | incicanfatalidades | incicanautosinvolucrados |
+-----------+----------------+----------+-------------------+------------
+------------+-----------+-------------+--
---------------+--------------------+--------------------------+
| 1 | 2012-09-30 | 500000 | 30000000 | 1 | 2012-09-
30 | DKZ820 | Bucaramanga |
0 | 0 | 2 |
+-----------+----------------+----------+-------------------+------------
+------------+-----------+-------------+--
---------------+--------------------+--------------------------+
1 row in set (0.00 sec)

mysql> select incicodigo, inciplaca, asefechainicio, asecosto, aseestado,


asevalorasegurado,incicantheridos from in
cidentes join aseguramientos on inciplaca = aseplaca and incicantheridos = 1;
+------------+-----------+----------------+----------+-----------
+-------------------+-----------------+
| incicodigo | inciplaca | asefechainicio | asecosto | aseestado |
asevalorasegurado | incicantheridos |
+------------+-----------+----------------+----------+-----------
+-------------------+-----------------+
| 2 | FLL420 | 2012-09-30 | 500000 | Vigente |
30000000 | 1 |
| 3 | FLL420 | 2012-09-30 | 500000 | Vigente |
30000000 | 1 |
+------------+-----------+----------------+----------+-----------
+-------------------+-----------------+
2 rows in set (0.00 sec)

mysql> select * from aseguramientos order by asecosto desc limit 1;


+-----------+----------------+--------------------+-------------------+-----------
+----------+----------+
| asecodigo | asefechainicio | asefechaexpiracion | asevalorasegurado | aseestado |
asecosto | aseplaca |
+-----------+----------------+--------------------+-------------------+-----------
+----------+----------+
| 3 | 2011-09-28 | 2012-09-28 | 50000000 | Vencido |
800000 | KJQ920 |
+-----------+----------------+--------------------+-------------------+-----------
+----------+----------+
1 row in set (0.00 sec)

mysql> select incicodigo, incifecha, inciplaca, incilugar, incicantheridos,


incicanfatalidades,incicanautosinvolucr
ados, asecodigo, asevalorasegurado from incidentes join aseguramientos on inciplaca
= aseplaca order by incicanauto
sinvolucrados asc limit 1;
+------------+------------+-----------+-----------+-----------------
+--------------------+-------------------------
-+-----------+-------------------+
| incicodigo | incifecha | inciplaca | incilugar | incicantheridos |
incicanfatalidades | incicanautosinvolucrados
| asecodigo | asevalorasegurado |
+------------+------------+-----------+-----------+-----------------
+--------------------+-------------------------
-+-----------+-------------------+
| 2 | 2012-09-27 | FLL420 | Gir�n | 1 |
0 | 1
| 1 | 30000000 |
+------------+------------+-----------+-----------+-----------------
+--------------------+-------------------------
-+-----------+-------------------+
1 row in set (0.00 sec)

mysql> select incifecha, inciplaca, incilugar, incicantheridos, asefechainicio,


asefechaexpiracion,asevalorasegurad
o from incidentes join aseguramientos on inciplaca = aseplaca and inciplaca =
'FLL420';
+------------+-----------+-------------+-----------------+----------------
+--------------------+-------------------
+
| incifecha | inciplaca | incilugar | incicantheridos | asefechainicio |
asefechaexpiracion | asevalorasegurado
|
+------------+-----------+-------------+-----------------+----------------
+--------------------+-------------------
+
| 2012-09-27 | FLL420 | Gir�n | 1 | 2012-09-30 | 2013-
09-30 | 30000000
|
| 2011-09-28 | FLL420 | Bucaramanga | 1 | 2012-09-30 | 2013-
09-30 | 30000000
|
+------------+-----------+-------------+-----------------+----------------
+--------------------+-------------------
+
2 rows in set (0.00 sec)

mysql> select * from compa�ia where comnit = '899999999-5';


+-------------+---------------------+------------+-----------------------+
| comnit | comnombre | coma�ofun | comreplegal |
+-------------+---------------------+------------+-----------------------+
| 899999999-5 | seguros del estadio | 2001 | maria margarita perez |
+-------------+---------------------+------------+-----------------------+
1 row in set (0.00 sec)

mysql> select asecodigo, asefechainicio, asefechaexpiracion, aseplaca,


aseestado,asevalorasegurado, automarca, auto
tipo, automodelo, autocilindraje, autonumchasis from aseguramientos join
automotores on aseplaca = autoplaca order
by asevalorasegurado desc limit 1;
+-----------+----------------+--------------------+----------+-----------
+-------------------+--------------+------
----+------------+----------------+-------------------+
| asecodigo | asefechainicio | asefechaexpiracion | aseplaca | aseestado |
asevalorasegurado | automarca | autot
ipo | automodelo | autocilindraje | autonumchasis |
+-----------+----------------+--------------------+----------+-----------
+-------------------+--------------+------
----+------------+----------------+-------------------+
| 3 | 2011-09-28 | 2012-09-28 | KJQ920 | Vencido |
50000000 | Kia sportage |
2 | 2009 | 2000 | wywzzz157kk009d25 |
+-----------+----------------+--------------------+----------+-----------
+-------------------+--------------+------
----+------------+----------------+-------------------+
1 row in set (0.00 sec)

mysql> select autoplaca, automarca, autotipo, automodelo, autonumpasajeros,


autocilindraje,autonumchasis, asefechai
nicio, asefechaexpiracion, aseestado, asevalorasegurado from automotores join
aseguramientos on aseplaca = autoplac
a and autotipo = 1;
+-----------+-----------------+----------+------------+------------------
+----------------+-------------------+----
------------+--------------------+-----------+-------------------+
| autoplaca | automarca | autotipo | automodelo | autonumpasajeros |
autocilindraje | autonumchasis | ase
fechainicio | asefechaexpiracion | aseestado | asevalorasegurado |
+-----------+-----------------+----------+------------+------------------
+----------------+-------------------+----
------------+--------------------+-----------+-------------------+
| FLL420 | Chevrolet corsa | 1 | 2003 | 5 |
1400 | wywzzz167kk009d25 | 201
2-09-30 | 2013-09-30 | Vigente | 30000000 |
| DKZ820 | Renault stepway | 1 | 2008 | 5 |
1600 | wywzzz157kk009d45 | 201
2-09-27 | 2013-09-27 | Vigente | 35000000 |
+-----------+-----------------+----------+------------+------------------
+----------------+-------------------+----
------------+--------------------+-----------+-------------------+
2 rows in set (0.00 sec)
mysql>

También podría gustarte