diff --git a/SQL Hell pt3.txt b/Semester 2/SQL Hell pt3.txt similarity index 100% rename from SQL Hell pt3.txt rename to Semester 2/SQL Hell pt3.txt diff --git a/Semester 2/SQL Hell pt4.txt b/Semester 2/SQL Hell pt4.txt new file mode 100644 index 0000000..69339ca --- /dev/null +++ b/Semester 2/SQL Hell pt4.txt @@ -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))); diff --git a/lamp/mysql/#ib_16384_0.dblwr b/lamp/mysql/#ib_16384_0.dblwr index 57df732..c3657e1 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 5ec31de..5f8cd9f 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 13eabc4..3f1c39a 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 d2f896e..9c73ed1 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 4d190db..6f6153e 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 267db73..2c589b1 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 fdc94c2..fbb6333 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 3be6caa..5a88832 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 3ce9a40..b5838ab 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 6d05852..fe68d56 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 8918e4f..557dc27 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/binlog.000019 b/lamp/mysql/binlog.000019 deleted file mode 100755 index fb6d860..0000000 Binary files a/lamp/mysql/binlog.000019 and /dev/null differ diff --git a/lamp/mysql/binlog.000035 b/lamp/mysql/binlog.000035 old mode 100644 new mode 100755 index 977c7e7..9c1f72d Binary files a/lamp/mysql/binlog.000035 and b/lamp/mysql/binlog.000035 differ diff --git a/lamp/mysql/binlog.000036 b/lamp/mysql/binlog.000036 new file mode 100644 index 0000000..2ed1acd Binary files /dev/null and b/lamp/mysql/binlog.000036 differ diff --git a/lamp/mysql/binlog.index b/lamp/mysql/binlog.index index 11aab58..60a329c 100644 --- a/lamp/mysql/binlog.index +++ b/lamp/mysql/binlog.index @@ -1,4 +1,3 @@ -./binlog.000019 ./binlog.000020 ./binlog.000021 ./binlog.000022 @@ -14,3 +13,4 @@ ./binlog.000033 ./binlog.000034 ./binlog.000035 +./binlog.000036 diff --git a/lamp/mysql/d6a8f2b56d7f.pid b/lamp/mysql/d6a8f2b56d7f.pid new file mode 100644 index 0000000..730a054 --- /dev/null +++ b/lamp/mysql/d6a8f2b56d7f.pid @@ -0,0 +1 @@ +172 diff --git a/lamp/mysql/e986610d0834.pid b/lamp/mysql/e986610d0834.pid old mode 100644 new mode 100755 diff --git a/lamp/mysql/ib_logfile0 b/lamp/mysql/ib_logfile0 index 5cf104b..305b472 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 70cb848..40c80bf 100755 Binary files a/lamp/mysql/ibdata1 and b/lamp/mysql/ibdata1 differ diff --git a/lamp/mysql/ibtmp1 b/lamp/mysql/ibtmp1 index c3989b9..75eaba7 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 384de1f..7c9f224 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 fe5001f..9befa14 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 f265d2d..0f9af95 100755 Binary files a/lamp/mysql/phpmyadmin/pma__userconfig.ibd and b/lamp/mysql/phpmyadmin/pma__userconfig.ibd differ diff --git a/lamp/mysql/undo_001 b/lamp/mysql/undo_001 index cf817ac..9bc3860 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 a4c088c..de139a7 100755 Binary files a/lamp/mysql/undo_002 and b/lamp/mysql/undo_002 differ