Reviweing Joins:
create table Fawad(
Fawad_ID INTEGER NOT NULL,
Fawad_value INTEGER NOT NULL
)
create table Nazir(
Nazir_ID INTEGER NOT NULL,
Nazir_value INTEGER NOT NULL
)
insert into fawad(Fawad_ID, FAWAD_VALUE) Values(1,100);
insert into fawad(Fawad_ID, FAWAD_VALUE) Values(2,200);
insert into fawad(Fawad_ID, FAWAD_VALUE) Values(3,300);
insert into Nazir(Nazir_ID, Nazir_VALUE) Values(3,100);
insert into Nazir(Nazir_ID, Nazir_VALUE) Values(4,200);
insert into Nazir(Nazir_ID, Nazir_VALUE) Values(5,300);
commit;
select * from fawad,nazir; -- product
select * from fawad join nazir on fawad.fawad_id = nazir.nazir_id; -- join
select * from fawad inner join nazir on fawad.fawad_id = nazir.nazir_id; -- inner join
select * from fawad left outer join nazir on fawad.fawad_id = nazir.nazir_id; -- left outer join
select * from fawad right outer join nazir on fawad.fawad_id = nazir.nazir_id; -- right outer join
select * from fawad full outer join nazir on fawad.fawad_id = nazir.nazir_id; -- full outer join
drop table fawad;
drop table nazir;
No comments:
Post a Comment