Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a database ( suppliers - parts - projects ) with the following schema: S ( S# , SNAME, STATUS, CITY ) P ( (

Consider a database (suppliers-parts-projects) with the following schema:
S ( S#, SNAME, STATUS, CITY )
P ((#, PNAME, COLOR, WEIGHT, CITY )
J(J#, JNAME, CITY )
SPJ (S#, P#, J#, QTY)
Suppliers (S), parts (P), and projects (J) are uniquely identified by supplier number (S*), part number (P#), and project number (J#), respectively. Below are some sample data of the database.
\table[[s,s#,SNAME,----,--,SPJ,s#,P#,?bar(J#),QTY],[STATUS,CITY,],[,s1,smith,20,London,,,?bar(s1),?bar(P1),J1,200],[,S2,Jones,10,Paris,,,s1,P1,J4,700],[,s3,Blake,30,Paris,,,s2,P3,J1,400],[,S4,Clark,20,London,,,s2,P3,J2,200],[,s5,Adams,30,Athens,,,s2,P3,J3,200],[,,,,,,,S2,P3,J4,500],[,-,dots,cdots,-cdots,,,S2,P3,J5,600],[P,P#,PNAME,COLOR,WEIGHT,CITY,,s2,P3,J6,400],[,-,-cdots,-cdots,,,,s2,P3,J7,800],[,P1,Nut,Red,12,London,,S2,P5,J2,100],[,P2,Bolt,Green,17,Par,,s3,P3,J1,200],[,P3,Screw,Blue,17,Rome,,S3,P4,J2,500],[,P4,Screw,Red,14,London,,S4,P6,J3,300],[,P5,Cam,Blue,12,Paris,,S4,P6,J7,300],[,P6,cog,Red,19,London,,S5,P2,J2,200],[,,,,,,,S5,P2,J4,100],[,--,--,,,,,S5,P5,J5,500],[J,J#,JNAME,CITY,,,,S5,P5,J7,100],[,--,,,-,,,S5,P6,J2,200],[,J1,Sorter,Par:,,,,$5,P1,J4,100],[,J2,Punch,Rome,,,,S5,P3,34,200],[,J3,Reader,Athe,ens,,,S5,P4,J4,800],[,J4,Console,Athe,ens,,,S5,P5,J4,400],[,J5,Collator,r Lonc,ion,,,S5,P6,J4,500],[,J6,Terminal,Oslc,,,,,,,],[,37,Tape,Lor,ion,,,,,,]]
Please complete the following questions with SQL SELECT statement (The SQL statements are required in the following questions. Students can also utilize the data to test their SQL statements in their computers though the testing is optional in this assignment).
(8) Get part numbers for parts supplied by a supplier in London to a project in London.
(9) Get all pairs of city names such that a supplier in the first city supplies a project in the second city.
(10) Get the total number of projects supplied by supplier S1.
image text in transcribed

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

4. What are the current trends in computer software platforms?

Answered: 1 week ago