Professional Documents
Culture Documents
AssignmentsDMLQ - Abhishek Pratap Singh
AssignmentsDMLQ - Abhishek Pratap Singh
product_i
product_name category_id
d
1 Pear 50
2 Banana 50
3 Orange 50
4 Grapefruit 50
5 Bread 75
6 Sliced Ham 25
7 Kleenex NULL
Dole Food
700 Westlake Village California
Company
There would be 2 records deleted and the employees table would now look like this:
There would be 3 records deleted and the suppliers table would now look like this:
supplier_nam
supplier_id city state
e
---1---
---2--
---3----
CREATE TABLE products
( product_id int NOT NULL,
product_name char(50) NOT NULL,
category_id int,
CONSTRAINT products_pk PRIMARY KEY (product_id)
);
INSERT INTO products (product_id, product_name, category_id) VALUES (1,'Pear',50);
INSERT INTO products (product_id, product_name, category_id) VALUES (2,'Banana',50);
INSERT INTO products (product_id, product_name, category_id) VALUES (3,'Orange',50);
INSERT INTO products (product_id, product_name, category_id) VALUES (4,'Apple',50);
INSERT INTO products (product_id, product_name, category_id) VALUES (5,'Bread',75);
INSERT INTO products (product_id, product_name, category_id)VALUES (6,'Sliced Ham',25);
INSERT INTO products (product_id, product_name, category_id) VALUES (7,'Kleenex',null);
---4---
---5---
--6---