Consultas
Publicado por Hannibal (1 intervención) el 23/11/2009 23:20:50
alter table ingreso add constraint cod_ing_pk primary key (cod_ing);
alter table autor alter column nacionalidad_aut set default 'Colombiano';
alter table autor add column fecha_nac_aut date;
insert into autor (cedula_aut, nombre_aut, apellido_aut, fecha_nac_aut, nacionalidad_aut) values ('004', 'Gabriel', 'Garcia', '2009-08-06', default), ('005','andres Manuel','Lopez Diaz','1752-08-06',default), ('006','Albert','Einstein','1872','Alemania');
update autor set nacionalidad_aut = default where cedula_aut='006';
update autor set nombre_aut='Moises' where cedula_aut='001';
update autor set (nacionalidad_aut, apellido_aut)=('alemania','Jimenez') where cedula_aut = '006' and nombre_aut = 'Albert';
insert into medico values ('HSV 01', 'Miguel Cadena', '310000000', 'Otorrinolaringologo');
select * from libro where id_est=(select id_est from estanteria where numero_est='434')
select * from libro where id_lib=(select id_lib from autlib where ced_aut = (select cedula_aut from autor where nombre_aut='gabriel'));
Select * from autor where extract (year from fecha_nac_aut) = 2007 and extract (month from fecha_nac_aut) = 08;
select * from autor where (to_char(fecha_nac_aut, 'yyyy')='2007') and (to_char(fecha_nac_aut, 'mm')='08');
select * from libro where id_est = (select id_est from estanteria where (numero_est = '4902' and lugar_est = 'C-45') );
select * from editorial where id_edi =(select id_edi from libro where id_lib = (select id_lib from autlib where ced_aut = (select cedula_aut from autor where nombre_aut = 'gabriel' )));
alter table ingreso add constraint ing_med_fk foreign key (cod_med) references medico (cod_med);
alter table paciente add constraint cod_pac_pk primary key (cod_pac);
alter table autor alter column nacionalidad_aut set default 'Colombiano';
alter table autor add column fecha_nac_aut date;
insert into autor (cedula_aut, nombre_aut, apellido_aut, fecha_nac_aut, nacionalidad_aut) values ('004', 'Gabriel', 'Garcia', '2009-08-06', default), ('005','andres Manuel','Lopez Diaz','1752-08-06',default), ('006','Albert','Einstein','1872','Alemania');
update autor set nacionalidad_aut = default where cedula_aut='006';
update autor set nombre_aut='Moises' where cedula_aut='001';
update autor set (nacionalidad_aut, apellido_aut)=('alemania','Jimenez') where cedula_aut = '006' and nombre_aut = 'Albert';
insert into medico values ('HSV 01', 'Miguel Cadena', '310000000', 'Otorrinolaringologo');
select * from libro where id_est=(select id_est from estanteria where numero_est='434')
select * from libro where id_lib=(select id_lib from autlib where ced_aut = (select cedula_aut from autor where nombre_aut='gabriel'));
Select * from autor where extract (year from fecha_nac_aut) = 2007 and extract (month from fecha_nac_aut) = 08;
select * from autor where (to_char(fecha_nac_aut, 'yyyy')='2007') and (to_char(fecha_nac_aut, 'mm')='08');
select * from libro where id_est = (select id_est from estanteria where (numero_est = '4902' and lugar_est = 'C-45') );
select * from editorial where id_edi =(select id_edi from libro where id_lib = (select id_lib from autlib where ced_aut = (select cedula_aut from autor where nombre_aut = 'gabriel' )));
alter table ingreso add constraint ing_med_fk foreign key (cod_med) references medico (cod_med);
alter table paciente add constraint cod_pac_pk primary key (cod_pac);
Valora esta pregunta
0