Exercise 6.5.1: Write the following database modifications, based on the databas
ID: 3704688 • Letter: E
Question
Exercise 6.5.1: Write the following database modifications, based on the database schema Product (maker, model, type) PC(model, speed, ram, hd, price) Laptop (model, speed, ram, hd, screen, price) Printer(model, color, type, price) of Exercise 2.4.1. Describe the effect of the modifications on the data of that exercise a) Using two INSERT statements, store in the database the fact that PC model 1100 is made by manufacturer C, has speed 3.2, RAM 1024, hard disk 180, and sells for $2499. c) Delete all PC's with less than 100 gigabytes of hard disk. e) Manufacturer A buys manufacturer B. Change all products made by B so they are now made by A.Explanation / Answer
a)
INSERT into Laptop (model,speed,ram,hd,screen,price) VALUES (1100,1024,180,2499);
INSERT into PC (maker,model,type) VALUES ('C',1100,'newmodel');
b)
DELETE FROM PC WHERE model IN (SELECT model FROM Laptop WHERE hd<=100000000000);
//1gb = 10^9bytes
c)
Update PC set maker='A' WHERE make='B';
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.