Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write in MySQL or according to MySQL. (because some other packages like Oracle commands for SQL are different from MySQL. I want MySQL.) You
Please write in MySQL or according to MySQL. (because some other packages like Oracle commands for SQL are different from MySQL. I want MySQL.)
You have to create the table, Populate with data and run the queries for getting output. Sufficient data need to be entered.
Please create a database with a size which will yield a good result(maybe 10 records, as given in the question), and provide it here.
Will upvote if your solution is correct.
Thanks.
2. Consider the following relational schema CUSTOMERS(cid, cname, city, ph_no) ITEMS(ino, iname, price, type) ORDERS( order_no, ino, cid, ord_date, qty) Note: Item type must be Groceries, Stationeries, or Electronics. Create tables through appropriate SQL commands specifying all integrity constraints. Insert at least 10 records in each table so that the following yields some results. Write SQL commands for the following queries: a. For each item type, display the item with the lowest price. b. Display the name of the customer who has ordered the highest-priced item. c. Display the names of the customers who have ordered the item mobile phone". d. Display the details of the customers who have NOT ordered more than 2 items in the last 6 months. e. Display the list of cities sorted by their number of orders. (City with the highest number of orders should top the list) f. Display the name of the city where customers ordered the highest number of electronicsStep 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