Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question Two: (40 marks). Al Salman shopping site stores information about customers, suppliers, products, orders, and deliveries. The information about the customer is kept in

image text in transcribed
image text in transcribed
Question Two: (40 marks). Al Salman shopping site stores information about customers, suppliers, products, orders, and deliveries. The information about the customer is kept in the customer relation. Suppliers' relation contains details about the suppliers of the products. Product relation contains the details about the products. Orders relation contains the details of orders. The details of each order are kept in the order-product relation. The details about the deliveries are kept in the deliveries relation. The details of the products in each delivery are kept in delivery- products relation. The relations are given below: customer (customer_id, customer_name, gender, date_of_birth, customer_phone, customer_address) supplier (supplier_id, supplier_name, supplier_email, supplier_phone, supplier_address) product (product_code, product_name, product_price, product_description) order (order_code, order_date, order_status, order_details, supplier_id) order_product (order_code, product_code, quantity) deliveries (delivery_id, delivery_date, delivery_status, delivery_details, customer_id) deliveries_products (delivery_id, product_code, quantity) Use the above relations and write SQL statements for the following questions: - Explain the working of each query in your own words. a. List all the details of male customers. (3 marks) b. Display order code and the supplier name of orders whose order date is before 31-12-2021 (5 marks) C. List each supplier id and the total number of orders for that supplier. Exclude the orders ended before 01- 11-2021. (5 marks) d. Display the customer id and the total number of deliveries of the customer. Sort the results in the descending order of the number of deliveries. (5 marks) Display the product code and the sum of quantity in each product code from deliveries_products table. Include only the product codes if the sum of quantity is greater than 100. (6 marks) Display the order code, product name, product price and quantity. (6 marks) g. Increase the price of product with product code 'P980 to 1%. (6 marks) Remove the customer with id 'C009. (4 marks) f. h

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

What's your biggest insecurity?

Answered: 1 week ago