Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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)
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 storesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started