Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

Students also viewed these Databases questions

Question

8. Providing support during instruction.

Answered: 1 week ago