Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

give an equivalent relational algebra and an equivalent Datalog query. The Assignment Information The following relational schema (primary keys are underlined) are used by the

image text in transcribed
give an equivalent relational algebra and an equivalent Datalog query.
image text in transcribed
The Assignment Information The following relational schema (primary keys are underlined) are used by the security company, West Park, described in Assignment 1, with some minor modifications. Stores(sid, name, address, phone) Products(barcode, name, description, price) Members(mid, name, contact Info, openAtStore, openTime, lastRenew Time) Transactions(sid, pid, transaction Time, customer, employee) TransactionContent(sid, pid, barcode) Return Transactions(returnStore, return Pid, sid, pid, barcode, return Time, returnComment, employee) This assignment is based on the above relational schema. Many details, including foreign keys, data types, etc, are captured in the SQL definition of these tables. You may use the supplied table definitions to create empty tables. You will need to populate the tables yourself in order to test your queries. 1. List sid, address and phone number of each store. 2. List the name and contact information of each customer whose last renew time is before January 20th, 2019. 3. For the returned product in each return transaction, list its name, purchase time, and its return time. 4. For each customer who has done at least one purchase transaction, list his/her member id, name and contact information. There should not be duplicates in the result. 5. For each purchase transaction done in January 1st, 2020 or later, list its transaction time, name of the member who made the purchase and the name of each product purchased in the transaction. 6. List the barcode, name and price of each product that has never being returned. 7. List the name and contact information of each member who has purchased at least one product but has never returned any purchased product. 8. For each (purchase or return) transaction assisted by the employee with the employee id 'K00236', list the transaction's (purchase or return respectively) store name and the (purchase or return) time. 9. List the name and price of each product that has NEVER purchased by the customer with the member id 300790013328. 10. List the barcode, the name and the price of each product that has been purchased by EVERY customer at least once

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

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions

Question

3. Discuss the process of behavior modeling training.

Answered: 1 week ago