diff --git a/Semester 2/SQL Hell pt 2.txt b/Semester 2/SQL Hell pt 2.txt new file mode 100644 index 0000000..8a2c22f --- /dev/null +++ b/Semester 2/SQL Hell pt 2.txt @@ -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) + ); diff --git a/lamp/mysql/#ib_16384_0.dblwr b/lamp/mysql/#ib_16384_0.dblwr index 488514c..1935757 100755 Binary files a/lamp/mysql/#ib_16384_0.dblwr and b/lamp/mysql/#ib_16384_0.dblwr differ diff --git a/lamp/mysql/#innodb_temp/temp_1.ibt b/lamp/mysql/#innodb_temp/temp_1.ibt index 371dfaf..de68a93 100644 Binary files a/lamp/mysql/#innodb_temp/temp_1.ibt and b/lamp/mysql/#innodb_temp/temp_1.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_10.ibt b/lamp/mysql/#innodb_temp/temp_10.ibt index bae6ff9..82418ba 100644 Binary files a/lamp/mysql/#innodb_temp/temp_10.ibt and b/lamp/mysql/#innodb_temp/temp_10.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_2.ibt b/lamp/mysql/#innodb_temp/temp_2.ibt index 3f20736..bf8b049 100644 Binary files a/lamp/mysql/#innodb_temp/temp_2.ibt and b/lamp/mysql/#innodb_temp/temp_2.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_3.ibt b/lamp/mysql/#innodb_temp/temp_3.ibt index 4785931..df2cf65 100644 Binary files a/lamp/mysql/#innodb_temp/temp_3.ibt and b/lamp/mysql/#innodb_temp/temp_3.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_4.ibt b/lamp/mysql/#innodb_temp/temp_4.ibt index b98a8a3..319e80d 100644 Binary files a/lamp/mysql/#innodb_temp/temp_4.ibt and b/lamp/mysql/#innodb_temp/temp_4.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_5.ibt b/lamp/mysql/#innodb_temp/temp_5.ibt index 00dbca8..591c7a8 100644 Binary files a/lamp/mysql/#innodb_temp/temp_5.ibt and b/lamp/mysql/#innodb_temp/temp_5.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_6.ibt b/lamp/mysql/#innodb_temp/temp_6.ibt index 38475ed..93585a2 100644 Binary files a/lamp/mysql/#innodb_temp/temp_6.ibt and b/lamp/mysql/#innodb_temp/temp_6.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_7.ibt b/lamp/mysql/#innodb_temp/temp_7.ibt index 8e81017..139a7b0 100644 Binary files a/lamp/mysql/#innodb_temp/temp_7.ibt and b/lamp/mysql/#innodb_temp/temp_7.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_8.ibt b/lamp/mysql/#innodb_temp/temp_8.ibt index 89b79ce..6532fff 100644 Binary files a/lamp/mysql/#innodb_temp/temp_8.ibt and b/lamp/mysql/#innodb_temp/temp_8.ibt differ diff --git a/lamp/mysql/#innodb_temp/temp_9.ibt b/lamp/mysql/#innodb_temp/temp_9.ibt index dc1c5c6..c4267ea 100644 Binary files a/lamp/mysql/#innodb_temp/temp_9.ibt and b/lamp/mysql/#innodb_temp/temp_9.ibt differ diff --git a/lamp/mysql/2763f9de9157.pid b/lamp/mysql/2763f9de9157.pid old mode 100644 new mode 100755 diff --git a/lamp/mysql/3b7ff37a44ba.pid b/lamp/mysql/3b7ff37a44ba.pid new file mode 100644 index 0000000..730a054 --- /dev/null +++ b/lamp/mysql/3b7ff37a44ba.pid @@ -0,0 +1 @@ +172 diff --git a/lamp/mysql/binlog.000032 b/lamp/mysql/binlog.000032 old mode 100644 new mode 100755 index 84e5d11..33ad64d Binary files a/lamp/mysql/binlog.000032 and b/lamp/mysql/binlog.000032 differ diff --git a/lamp/mysql/binlog.000033 b/lamp/mysql/binlog.000033 new file mode 100644 index 0000000..3061a46 Binary files /dev/null and b/lamp/mysql/binlog.000033 differ diff --git a/lamp/mysql/binlog.index b/lamp/mysql/binlog.index index 893fe7d..2c8ddd1 100644 --- a/lamp/mysql/binlog.index +++ b/lamp/mysql/binlog.index @@ -29,3 +29,4 @@ ./binlog.000030 ./binlog.000031 ./binlog.000032 +./binlog.000033 diff --git a/lamp/mysql/ib_logfile0 b/lamp/mysql/ib_logfile0 index db24eda..ef0f061 100755 Binary files a/lamp/mysql/ib_logfile0 and b/lamp/mysql/ib_logfile0 differ diff --git a/lamp/mysql/ibdata1 b/lamp/mysql/ibdata1 index d651559..e4ae527 100755 Binary files a/lamp/mysql/ibdata1 and b/lamp/mysql/ibdata1 differ diff --git a/lamp/mysql/ibtmp1 b/lamp/mysql/ibtmp1 index 2890a1e..6d4cd02 100644 Binary files a/lamp/mysql/ibtmp1 and b/lamp/mysql/ibtmp1 differ diff --git a/lamp/mysql/mysql.ibd b/lamp/mysql/mysql.ibd index be61c60..466a48a 100755 Binary files a/lamp/mysql/mysql.ibd and b/lamp/mysql/mysql.ibd differ diff --git a/lamp/mysql/phpmyadmin/pma__recent.ibd b/lamp/mysql/phpmyadmin/pma__recent.ibd index e30b42f..55bffed 100755 Binary files a/lamp/mysql/phpmyadmin/pma__recent.ibd and b/lamp/mysql/phpmyadmin/pma__recent.ibd differ diff --git a/lamp/mysql/phpmyadmin/pma__userconfig.ibd b/lamp/mysql/phpmyadmin/pma__userconfig.ibd index 633156d..388f0b7 100755 Binary files a/lamp/mysql/phpmyadmin/pma__userconfig.ibd and b/lamp/mysql/phpmyadmin/pma__userconfig.ibd differ diff --git a/lamp/mysql/suppliers_parts_23/supplier.ibd b/lamp/mysql/suppliers_parts_23/supplier.ibd index 7db6c63..8015782 100755 Binary files a/lamp/mysql/suppliers_parts_23/supplier.ibd and b/lamp/mysql/suppliers_parts_23/supplier.ibd differ diff --git a/lamp/mysql/undo_001 b/lamp/mysql/undo_001 index d071449..620a371 100755 Binary files a/lamp/mysql/undo_001 and b/lamp/mysql/undo_001 differ diff --git a/lamp/mysql/undo_002 b/lamp/mysql/undo_002 index 36d6790..6940e58 100755 Binary files a/lamp/mysql/undo_002 and b/lamp/mysql/undo_002 differ