Vous êtes sur la page 1sur 4

Createdatabase macanico automotriz;

use taller;
createtable cliente
(nf int,
nombre char (20),
direccin char (25),
ciudad char (25),
tfno int,
primarykey (nf));
createtable coche
(matricula int,
marca char (32),
modelo int,
colorchar (35),
precioint,
primarykey (matricula));
createtable revicion
(codigoint,
filtro char (25),
aceite char (27),
frenos char (25),
primarykey (codigo));
showtables;
insert into cliente values (1, "pedro", "cuahutemoc", "jojutla", 3578275);
insert into cliente values (2, "juan", "galeana", "zacatepec", 3437879);
insert into cliente values (3, "carlos", "valle", "D.F", 5534698);
insert into cliente values (4, "leo", "galeana", "zacatepec", 3456972);
insert into cliente values (5, "enrrique", "galeana", "zacatepec", 3434556);
insert into cliente values (6, "fernando", "xoxocotla", "tehuxtla", 3445678);
insert into cliente values (7, "victor", "xoxocotla", "tehuixta", 3423455);

insert into coche values (1111, "ford", 2000, "azul", 65000);
insert into coche values (1112, "nissan", 98, "verde", 50000);
insert into coche values (1113, "chevi", 2012, "amarillo", 100750);
insert into coche values (1114, "mustang", 2015, "rosa", 250780);
insert into coche values (1115, "nissan", 2010, "turqueza", 234000);
insert into coche values (1116, "ford", 2015, "dorado", 370000);
insert into coche values (1117, "chevi", 2000, "morado", 56000);

insert into revicion values (1786, "axz", "kuaker", "ads");
insert into revicion values (1787, "kuetara", "roma", "curl");
insert into revicion values (1788, "kilo", "superz", "axb");
insert into revicion values (1789, "mop", "aguahzo", "hloo");
insert into revicion values (1790, "mupa", "roma", "ads");
insert into revicion values (1791, "exxi", "kuaker", "axb");
insert into revicion values (1792, "xxx", "superz", "ads");

select nombre from cliente where nombre = "pedro";
select nombre, direccin from cliente where "pedro" "jojutla";

select marca from coche where marca = "ford";
select marca, color from coche where "ford" "azul" ;

select filtro from revicion where filtro = "axz";
select filtro, aceite from revicion where "axz" "kuaker";

update cliente set Tfno = 3478275 wherenf = 1;
update coche set marca = "ford" where matricula = 1111;
update revicion set aceite = "kuaker" where codigo = 1786;

delete from cliente where nf = 7;
delete from coche where matricula = 1117;
delete from revicion where codigo = 1792;

select * from cliente;
select * from coche;
select * from revicion;

droptable cliente;
droptable coche;
droptable revicion;

dropdatabase mecanico automotriz;

Vous aimerez peut-être aussi