AAAAAAAAAAAAAAAAAAAAAAAA

master
Caleb Fontenot 2023-09-20 19:03:36 +07:00
parent f386902358
commit 4fb4cff722
26 changed files with 43 additions and 0 deletions

@ -0,0 +1,41 @@
/* 1. list the snumber, sname, and pnumber for suppliers who supply parts but the condition of the joins is in the where clause */
select supplier.snumber, sname, pnumber, jnumber
from supplier, spj
where spj.snumber = supplier.snumber
/* 2. list the snumber, sname, and pnumber for suppliers USING SUBQUERIES aka nested selects */
select snumber, (select a.sname from supplier as a where a.snumber = spj.snumber)
pnumber, jnumber
from spj
where spj.snumber in
(select supplier.snumber from supplier);
/* 3. list the snumber, sname, and pnumber for suppliers USING SUBQUERIES aka nested selects */
select snumber, (select a.sname from supplier as a
where a.snumber = spj.snumber)
(select b.jname from project as b
where b.jnumber = spj.jnumber),
pnumber, jnumber
from spj
where spj.snumber in
(select supplier.snumber
from supplier);
/*4. List the snumber, sname, pnumber, jnumber and jname for suppliers who supply parts but not the condition for all joins in there WHERE clause */
select supplier.snumber, sname, spj.jnumber, jname
from supplier, spj, project
where supplier.snumber = spj.snumber AND
spj.jnumber = project.jnumber;
select * /* for i 0 to number of suppliers */
from supplier
where snumber in
(select snumber /* for j 0 to number of tuples in spj */
from spj
where jnumber IN
(select jnumber /* for K 0 to number of tuples in project */
from project)
);

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -29,3 +29,4 @@
./binlog.000030
./binlog.000031
./binlog.000032
./binlog.000033

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.