Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the relational schema given in Figure 1. Read the description, and write the SQL statement to answer the sub-questions. Customer (id, name, city,

Consider the relational schema given in Figure 1. Read the description, and write the SQL statement to answer

Consider the relational schema given in Figure 1. Read the description, and write the SQL statement to answer the sub-questions. Customer (id, name, city, credit card) Merchant (id, name, city, account) Merchant-Phone (id, phone) Handling-Fee (product id, handling rate, description) Purchase (purchase id, time, date, customer_id) Product (product_id, description, price, merchant_id) Consist (purchase id, product_id, quantity) Figure 1: Product -Purchase tracking a) Identify the foreign keys in this schema. (6 marks) b) Display the customer's id for all customer who have purchased product on "T0/06/2019" or on "11/06/2019". (8 marks) c) For each merchant, display the id and total amount of money that its products cost (disregarding handling fees), under the condition that the total amount is greater than 500. The result should be ordered in descending order of the total amount. (6 marks) Activate Window

Step by Step Solution

3.33 Rating (153 Votes )

There are 3 Steps involved in it

Step: 1

Based on the provided relational schema in Figure 1 here are the SQL statements that correspond to t... 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

Fundamentals of Database Systems

Authors: Ramez Elmasri, Shamkant Navathe

6th edition

136086209, 978-0136086208

More Books

Students also viewed these Programming questions

Question

=+c. Number of times interest charges earned

Answered: 1 week ago

Question

Prove that any relation schema with two attributes is in BCNF.

Answered: 1 week ago