DATABASE SYSTEM 2. Consider the following database of a convenience-store chain
ID: 3709310 • Letter: D
Question
DATABASE SYSTEM
2. Consider the following database of a convenience-store chain with a number of stores in different locations selling various products: Store (StoreID, StoreLocation) Product (ProductName, UnitPrice, SupplierName) Inventory ProductName, StorelD) Supplier (SupplierName, SupplierAddress, SupplierPhone) Write SQL for the following: Return the locations of those stores that have both tomato and lettuce in their inventories. (a) (5 Marks) (b) Return the names of the products whose unit prices are below the average unit price of all the products. (5 Marks) (c) Each store has an average unit price, which is the average of the unit prices of the products available at the store. Return each store name with its average unit price. (5 Marks) (d) Return the product(s) that is/are available in at least three stores. (5 Marks) Return the IDs of those stores that have the maximum number of products (5 Marks) (e) among all the stores.Explanation / Answer
Below is the answer for the first 4 subparts:
Please upvote if you find the answer satisfactory :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.