1. Homepage
  2. Exam
  3. COMP2420/COMP6420 - 2022 Sample - Q1 Data Management

COMP2420/COMP6420 - 2022 Sample - Q1 Data Management

This question has been solved
Engage in a Conversation

Q1) Data Management (20 marks)

Questions part 1 and part 2 refer to the Supplier-Part-Jobs database. The scheme for this database is as follows: CourseNana.COM

  • suppliers (s_id, name, status, city) -- the information about suppliers
  • parts (p_id, name, colour, weight, city) -- the information about parts
  • job (j_id, name, city) -- the information about jobs
  • supplier_inventory (s_id, p_id, quantity) -- the quantity of each part that suppliers currently hold
  • requests (s_id, p_id, j_id, quantity) -- the amount of each part requested from a supplier for a job

Part 1 Relational Algebra (6 marks)

Please evaluate the following relational algebra expressions on the following presented subset of the Supplier-Parts-Jobs database. CourseNana.COM

Suppliers (S): CourseNana.COM

s_idnamestatuscity
S1Smith20London
S2Jones10Paris
S3Blake30Paris

Parts (P): CourseNana.COM

p_idnamecolourweightcity
P1NutRed12.0London
P2BoltGreen17.0Paris
P3ScrewBlue17.0Rome
P4ScrewRed14.0London

Jobs (J): CourseNana.COM

j_idnamecity
J1SorterParis
J2DisplayRome
J3OCRAthens

Requests (R): CourseNana.COM

s_idp_idj_idquantity
S1P1J1200
S2P2J1400
S2P3J2250
S2P3J3200
S3P3J1300
S3P4J2500

For a) and b) since you can't draw tables, please write your answer as comma separated values, including the column headers. e.g.
id, column2, column3
1, Trevor, Computing
2, James, Business
3, Sarah, Engineering CourseNana.COM

a) (2 marks) (σquantity>200quantity<=400  (R))R CourseNana.COM

b) (2 marks) (πsid, pid(S×P))(πsid, pid(R)) CourseNana.COM

c) (2 marks) Describe in English what the following RA computes: CourseNana.COM

σJ.city=P.city((RJ)R.pid=P.pidP)

Get the Solution to This Question

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp