a
This commit is contained in:
parent
744adf4004
commit
933f6da297
45
Semester 2/SQL Hell pt4.txt
Normal file
45
Semester 2/SQL Hell pt4.txt
Normal file
@ -0,0 +1,45 @@
|
||||
/* What are the suppliers that supply all parts using NOT EXISTS */
|
||||
/* sp difference A */
|
||||
select DISTINCT snumber
|
||||
from spj as c
|
||||
where not EXISTS
|
||||
/* A */
|
||||
/* Cross Product */
|
||||
(select DISTINCT b.snumber
|
||||
from part as a cross join spj as b
|
||||
where c.snumber = b.snumber and not EXISTS
|
||||
/* difference cross product sp */
|
||||
(select snumber, pnumber from spj
|
||||
where b.snumber = spj.snumber and a.pnumber = spj.pnumber));
|
||||
|
||||
|
||||
/* What are the suppliers that supply all parts using NOT EXISTS * */
|
||||
/* sp difference A */
|
||||
select DISTINCT snumber
|
||||
from spj as c
|
||||
where not EXISTS
|
||||
/* A */
|
||||
/* Cross Product */
|
||||
(select *
|
||||
from part as a cross join spj as b
|
||||
where c.snumber = b.snumber and not EXISTS
|
||||
/* difference cross product sp */
|
||||
(select * from spj
|
||||
where b.snumber = spj.snumber and a.pnumber = spj.pnumber));
|
||||
|
||||
|
||||
/* What are the suppliers that supply all parts using NOT EXISTS *, list their names and their cities */
|
||||
select snumber, sname, city from supplier
|
||||
WHERE snumber in
|
||||
(/* sp difference A */
|
||||
select DISTINCT snumber
|
||||
from spj as c
|
||||
where not EXISTS
|
||||
/* A */
|
||||
/* Cross Product */
|
||||
(select *
|
||||
from part as a cross join spj as b
|
||||
where c.snumber = b.snumber and not EXISTS
|
||||
/* difference cross product sp */
|
||||
(select * from spj
|
||||
where b.snumber = spj.snumber and a.pnumber = spj.pnumber)));
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lamp/mysql/binlog.000035
Normal file → Executable file
BIN
lamp/mysql/binlog.000035
Normal file → Executable file
Binary file not shown.
BIN
lamp/mysql/binlog.000036
Normal file
BIN
lamp/mysql/binlog.000036
Normal file
Binary file not shown.
@ -1,4 +1,3 @@
|
||||
./binlog.000019
|
||||
./binlog.000020
|
||||
./binlog.000021
|
||||
./binlog.000022
|
||||
@ -14,3 +13,4 @@
|
||||
./binlog.000033
|
||||
./binlog.000034
|
||||
./binlog.000035
|
||||
./binlog.000036
|
||||
|
1
lamp/mysql/d6a8f2b56d7f.pid
Normal file
1
lamp/mysql/d6a8f2b56d7f.pid
Normal file
@ -0,0 +1 @@
|
||||
172
|
0
lamp/mysql/e986610d0834.pid
Normal file → Executable file
0
lamp/mysql/e986610d0834.pid
Normal file → Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user