diff --git a/SQL Hell pt3.txt b/SQL Hell pt3.txt new file mode 100644 index 0000000..cbd2d36 --- /dev/null +++ b/SQL Hell pt3.txt @@ -0,0 +1,33 @@ +/* list suppliers who have QTYs greater than the the QTYs of s4 */ +select snumber, qty +from spj +where qty > ALL +(select qty +from spj +where snumber = 's4'); + + +/*List suppliers who have qty smaller than any qty of s2*/ + +SELECT snumber, qty +FROM spj +WHERE qty < ANY(SELECT qty FROM spj WHERE snumber = "s2"); + +/*List the snumber and QTYs of the supplier who relates with the snumber to the QTYs that are greater than the AVG QTYs of the particular supplier. +i.e. for s1 the AVG of all its QTY is x... You must list all the QTYs of s1 that are greater than x. +*/ +select snumber, qty +from spj as a +where qty > +(select avg(qty) + from spj + where a.snumber = snumber); + + + /* EXISTS demo */ + + select * +from supplier a +where not EXISTS + (select * from spj + where snumber = a.snumber); diff --git a/lamp/mysql/#ib_16384_0.dblwr b/lamp/mysql/#ib_16384_0.dblwr index 1935757..a205fcb 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 de68a93..a649195 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 82418ba..d3de8c0 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 bf8b049..964d1d8 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 df2cf65..8e72448 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 319e80d..67988c7 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 591c7a8..2aab55d 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 93585a2..4074920 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 139a7b0..6fd53ec 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 6532fff..dbf6a0e 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 c4267ea..2fe8fd3 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/03046387ad9d.pid b/lamp/mysql/03046387ad9d.pid new file mode 100644 index 0000000..1057e9a --- /dev/null +++ b/lamp/mysql/03046387ad9d.pid @@ -0,0 +1 @@ +176 diff --git a/lamp/mysql/3b7ff37a44ba.pid b/lamp/mysql/3b7ff37a44ba.pid old mode 100644 new mode 100755 diff --git a/lamp/mysql/binlog.000033 b/lamp/mysql/binlog.000033 old mode 100644 new mode 100755 index 3061a46..9c6203d Binary files a/lamp/mysql/binlog.000033 and b/lamp/mysql/binlog.000033 differ diff --git a/lamp/mysql/binlog.000034 b/lamp/mysql/binlog.000034 new file mode 100644 index 0000000..75b427c Binary files /dev/null and b/lamp/mysql/binlog.000034 differ diff --git a/lamp/mysql/binlog.index b/lamp/mysql/binlog.index index 2c8ddd1..ad70820 100644 --- a/lamp/mysql/binlog.index +++ b/lamp/mysql/binlog.index @@ -30,3 +30,4 @@ ./binlog.000031 ./binlog.000032 ./binlog.000033 +./binlog.000034 diff --git a/lamp/mysql/ib_logfile0 b/lamp/mysql/ib_logfile0 index ef0f061..ac89978 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 e4ae527..221f53c 100755 Binary files a/lamp/mysql/ibdata1 and b/lamp/mysql/ibdata1 differ diff --git a/lamp/mysql/ibtmp1 b/lamp/mysql/ibtmp1 index 6d4cd02..ed24b9d 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 466a48a..2756672 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 55bffed..0b842f3 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 388f0b7..7f90b1f 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 620a371..db5021b 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 6940e58..a3be05d 100755 Binary files a/lamp/mysql/undo_002 and b/lamp/mysql/undo_002 differ