Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3) Open a new SQL worksheet then write in SQL the queries, which answer the questions below. Save the script as queries.sql. (write the

3) Open a new SQL worksheet then write in SQL the queries, which answer the questions below. Save the script as queries.sql.

3) Open a new SQL worksheet then write in SQL the queries, which answer the questions below. Save the script as queries.sql. (write the number of question as comment before each query) a) Display in alphabetical order the list of cities in which there is at least one customer.[0.5] b) Display the number, name and city of customers who belong to category C1 and who are not living in Muscat. [0.5] c) List the characteristics of products made of steel.[0.5] d) Display the details of products having a price under 200 and a stock more than 150.[0.5] e) List the number, name and balance of customers who are from Salalah or Ibri and whose balance is positive. [0.5] f) List the number of cities in which there are customers of category C1.[0.5] g) Display the number of customers who have placed at least one order. [0.5] h) Calculate, for each city, the number of distinct categories. [0.75] i) Assign zero to the balance of customers of category C1 and whose balance is negative. [0.75] j) Change to 10 units the ordered quantity of the product number PA60 in the order number 30185.[0.75] k) Calculate the total amount in the stock of products made of fir. [0.75] 1) Display the details (orderNO, orderDate) of the most recent order. [1] m) Display the details of orders (orderNO, orderDate, customerNO) which doesn't include the products having the code PA60. [1] n) Display numbers and names of customers who are from Muscat and have not placed orders. [1] o) Display numbers of products (productNO) which are made of fir and are placed in orders. [1] p) Find for each product the list of cities in which this product is ordered in more than 500 units. [1.5] q) List, for each customer category, the number of products that were ordered on 23-12- 2008.[1.5]

Step by Step Solution

3.61 Rating (162 Votes )

There are 3 Steps involved in it

Step: 1

a Display in alphabetical order the list of cities in which there is at least one customer SELECT DISTINCT city FROM customers ORDER BY city ASC b Display the number name and city of customers who bel... 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

Introduction To Statistical Investigations

Authors: Beth L.Chance, George W.Cobb, Allan J.Rossman Nathan Tintle, Todd Swanson Soma Roy

1st Edition

1118172140, 978-1118172148

More Books

Students also viewed these Algorithms questions

Question

What has been your desire for leadership in CVS Health?

Answered: 1 week ago

Question

Question 5) Let n = N and Y Answered: 1 week ago

Answered: 1 week ago