PRJ
PRJ
PRJ
535]
(c) 2019 Microsoft Corporation. All rights reserved.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> delete *
-> from skincare
-> where skincare.brand='Sephore' and skincare.brand_id='b-5';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '*
from skincare
where skincare.brand='Sephore' and skincare.brand_id='b-5'' at line 1
mysql> delete
-> from skincare
-> where skincare.brand='Sephore' and skincare.brand_id='b-5';
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint
fails (`cosmetics`.`sale`, CONSTRAINT `sale_ibfk_2` FOREIGN KEY (`sk_id`)
REFERENCES `skincare` (`sk_id`))
mysql> delete from skincare where sk_id not in(select sk_id from sale);
Query OK, 2 rows affected (0.13 sec)
mysql>mysql> select item from makeup natural join sale where sale.m_id='m-9';
+----------+
| item |
+----------+
| Lipstick |
+----------+
1 row in set (0.00 sec)