Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**********************Note that Question 2 has 4 parts********************** Use the following specifications and create the required SQL statements Based on these tables between Suppliers & Parts

image text in transcribed

**********************Note that Question 2 has 4 parts**********************

image text in transcribed

Use the following specifications and create the required SQL statements Based on these tables between Suppliers & Parts shown in Figure 1, write the SQL statements that correspond to the conditions of each question Figure 1: Relation S... contains information about suppliers SNAME SNO Supplier number (PK) primary key.. varchar STATUS Supplier status (e.g, reliability code between 1 and5 with 1 being best, 5 worst)int CITY Supplier name varchar , supplier's location varchar Relation P..contains information about parts Weight supplier location PNO PNAME Name of the part varchar COLOR Part number (PK) primary key Part color Relation SP ...contains information about which parts are supplied by which suppliers in which quantities SNO Supplier number (PK) (FK) part of primary key, foreign key .. varchar PNO QTY Part color int Part number (PK) (FK) part of primary key, foreign key . varchar MORE COMPACT FORM SN IG SP SNO PNO Example: Find information (write SQL statement to find information) about suppliers who are located in London. Display/show/retrieve the supplier numbers and names Answer: SELECT sno, sname FROM s WHERE city = London Questions: 1 Find information about suppliers located in London who supply part P2. The query (SQL statement) should retrieve the supplier numbers and names. 2 Find information about red parts that are supplied by any suppliers located in Paris. Retrieve the supplier numbers and names and also the corresponding red parts they supply a. To join tables, you may only use the JOIN-USING variation of a join. b. To join tables, you may only use the JOIN-ON variation of a join c. To join tables, you may only use the NATURAL-JOIN variation of a join. d. To join tables, you may only use the CROSS-JOIN version with WHERE clause. In other words, your SQL statement will not have a keyword "JOIN" in it in any form. 3 For each red part, display information about which suppliers supply it, if any. In other words, if a part is not supplied by any supplier, it still must appear in the result. (Hint: Use either LEFT or RIGHT OUTERJOIN.)

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

Students also viewed these Databases questions

Question

Explain the process of MBO

Answered: 1 week ago