Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following structure and answer the follwoing answers: CREATE TABLE Pieces ( Code INTEGER PRIMARY KEY NOT NULL, Name TEXT NOT NULL ); CREATE

Consider the following structure and answer the follwoing answers:

CREATE TABLE Pieces ( Code INTEGER PRIMARY KEY NOT NULL, Name TEXT NOT NULL ); CREATE TABLE Providers ( Code VARCHAR(40) PRIMARY KEY, Name TEXT NOT NULL ); CREATE TABLE Provides ( Piece INTEGER , Provider VARCHAR(40), Price INTEGER NOT NULL ); INSERT INTO Providers(Code, Name) VALUES('HAL','Clarke Enterprises'); INSERT INTO Providers(Code, Name) VALUES('RBT','Susan Calvin Corp.'); INSERT INTO Providers(Code, Name) VALUES('TNBC','Skellington Supplies'); INSERT INTO Pieces(Code, Name) VALUES(1,'Sprocket'); INSERT INTO Pieces(Code, Name) VALUES(2,'Screw'); INSERT INTO Pieces(Code, Name) VALUES(3,'Nut'); INSERT INTO Pieces(Code, Name) VALUES(4,'Bolt'); INSERT INTO Provides(Piece, Provider, Price) VALUES(1,'HAL',10); INSERT INTO Provides(Piece, Provider, Price) VALUES(1,'RBT',15); INSERT INTO Provides(Piece, Provider, Price) VALUES(2,'HAL',20); INSERT INTO Provides(Piece, Provider, Price) VALUES(2,'RBT',15); INSERT INTO Provides(Piece, Provider, Price) VALUES(2,'TNBC',14); INSERT INTO Provides(Piece, Provider, Price) VALUES(3,'RBT',50); INSERT INTO Provides(Piece, Provider, Price) VALUES(3,'TNBC',45); INSERT INTO Provides(Piece, Provider, Price) VALUES(4,'HAL',5); INSERT INTO Provides(Piece, Provider, Price) VALUES(4,'RBT',7); 1 Select the name of all the pieces. 2 Select all the providers' data, including what pieces they provide 3 Obtain the average price of each piece (show only the piece code and the average price). 4 Obtain the names of all providers who supply piece 1. 5 Select the name of pieces provided by provider with code "HAL". 6 Add an entry to the database to indicate that "Skellington Supplies" (code "TNBC") will provide sprockets (code "1") for 7 cents each. 7 Increase all prices by one cent. 8 Update the database to reflect that "Susan Calvin Corp." (code "RBT") will not supply bolts (code 4). 9 Update the database to reflect that "Susan Calvin Corp." (code "RBT") will not supply any pieces 10 Remove all products produced by the 'Susan Calvin Corp'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions