Question

You are working with a database that stores information about suppliers, parts and projects. The Supply...

You are working with a database that stores information about suppliers, parts and projects. The Supply relation records instances of a Supplier supplying a Part for a Project.

The schema for the database used in this question is as follows: (note that primary keys are shown underlined, foreign keys in bold).

SUPPLIER (SNo, SupplierName, City)

PART (PNo, PartName, Weight)

PROJECT (JobNo, JobName, Country)

SUPPLY (SNo, PNo, JobNo, Quantity)

Provide relational algebra (NOT SQL) queries to find the following information. Each question is worth 2 marks.

NOTE:

  • You can use the symbols s, P, etc or the words ‘PROJECT’, ‘RESTRICT’ etc as you prefer.
  • You do not need to try to make efficient queries – just correct ones.
  • Where you use a join, always show the join condition.
  1. List the name and city of all suppliers.
  2. List all details of Projects being run in Australia.
  3. List the Project name and Part name of any Parts where more than 50 of the part has been supplied to a particular project
  4. List the names of Suppliers who have supplied the Part with the name “Valve Stem 04”.
  5. List the names of Projects that have had Parts supplied by Zloof Co# or a Supplier located in Perth.
  6. List the names of all Projects and the Parts supplied to them, if any.
  7. List the name of any Supplier who supplied Parts to the Project called “Project 01” and to the Project called “Project 02”.
  8. List the name of any Supplier who supplied Parts to the Project called “Project 01” but not to the Project called “Project 02”.
  9. List the name of any Supplier who supplied Parts to the Project called “Project 01” or to the Project called “Project 02”.
  10. List the names of any Supplier who has supplied Parts for all Projects run in Australia.

NO SQL, Please write nicely so that i can see! Thank you!

Homework Answers

Answer #1

1.

SupplierName, City ( SUPPLIER)

2.

( Country = 'Austrailia' (PROJECT) )

3.

JobName, PartName ( PROJECT.PNo G Count(partNo) > 50 ( PART PNo = PNo SUPPLY JobNo = JobNo PROJECT) )

4.

SupplierName ( ParName = 'Valve Stem 04' ( PART PNo = PNo SUPPLY SNo = SNo SUPPLIER) )

Do ask if any doubt.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
SUPPLIER Sno Sname Status City s1 Smith 20 London s2 Jones 10 Paris s3 Blake 30...
SUPPLIER Sno Sname Status City s1 Smith 20 London s2 Jones 10 Paris s3 Blake 30 Paris s4 Clark 20 London s5 Adams 30 NULL PART Pno Pname Color Weight City p1 Nut Red 12 London p2 Bolt Green 17 Paris p3 Screw NULL 17 Rome p4 Screw Red 14 London p5 Cam Blue 12 Paris p6 Cog Red 19 London SHIPMENT Sno Pno Qty Price s1 p1 300 .005 s1 p2 200 .009 s1 p3 400 .004 s1 p4...
Specify the following queries in SQL on the COMPANY database. Show the result of each query....
Specify the following queries in SQL on the COMPANY database. Show the result of each query. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ‘ProductX’ project. List the names of all employees who have a dependent with the same first name as themselves. Find the names of all employees who are directly supervised by ‘Franklin Wong’. Specify the following updates using the SQL update commands. Show the state of...
SUPPLIER Sno Sname Status City s1 Smith 20 London s2 Jones 10 Paris s3 Blake 30...
SUPPLIER Sno Sname Status City s1 Smith 20 London s2 Jones 10 Paris s3 Blake 30 Paris s4 Clark 20 London s5 Adams 30 NULL PART Pno Pname Color Weight City p1 Nut Red 12 London p2 Bolt Green 17 Paris p3 Screw NULL 17 Rome p4 Screw Red 14 London p5 Cam Blue 12 Paris p6 Cog Red 19 London SHIPMENT Sno Pno Qty Price s1 p1 300 .005 s1 p2 200 .009 s1 p3 400 .004 s1 p4...
Write a SQL statement which joins the parts table with the supplier table and lists the...
Write a SQL statement which joins the parts table with the supplier table and lists the part_name, supplier_name for all parts in the part table. The supplier_id column in the suppliers table is the primary key in the suppliers table, and this key has been exported to the parts table where it is a foreign key. You should use an inner join for this query. Write a SQL statement which joins the parts table with the suppliers table and lists...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make the files to create and populate the Company database available on Isadore shortly): List the last name and address of managers who have a dependent with the same first name as themselves. Retrieve the names of all employees who are directly supervised by ‘Franklin Wong’. Retrieve the names of employees in the Research department who work more than 20 hours per week on the...
Write the following four queries in MySQL using the supplies database. Please make sure to submit...
Write the following four queries in MySQL using the supplies database. Please make sure to submit a screenshot of the output of each of your query. (100 points) 1. Find the sids of suppliers who charge more for some part than the average cost of that part (averaged over all the suppliers who supply that part). 2. For each part, find the sname of the supplier who charges the most for that part. 3. Find the sids of suppliers who...
Assignment 2 Instructions You need to access to the database and write SQL queries on the...
Assignment 2 Instructions You need to access to the database and write SQL queries on the following site: https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in 1. Use INNER JOIN to create a report. In this report, list each customer’s CustomerID, CustomerName, and their each OrderID and each order’s OrderDate, if the customer has ever placed an order. You should use the Customers table and the Orders table in the database to complete this query.   2. Use INNER JOIN to create a report. In this report, list...
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects....
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch08_ConstructCo database are shown in Figure P8.1. Use this database to answer the following problems. Database Schema The schema for the Ch08_ConstructCo database is shown below and should be used to answer the next several problems. Click this image to view it in its own...
You are tasked to design the ER diagram for the database for the 3S clothing store....
You are tasked to design the ER diagram for the database for the 3S clothing store. Data requirements are as given below. • Information about 3S employees includes a unique employee ID, and his/her name and position. • Each customer of 3S is identified by a customer ID, and has a name. • Information about the suppliers of 3S include a unique name, and a contact phone number. • Clothes stocked by 3S are described by a product code, size,...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT