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_ld product_code, quantity) a. C. Use the above relations and write SQL statements for the following questions: - Explain the working of each query in your own words. (3 marks) List all the details of male customers. b. Display order code and the supplier name of orders whose order date is before 31-12- 2021 (5 marks) 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) e. Display the product code and the sum of quantity in each product code from deliveries_products table. Inclyde 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) 9. Increase the price of product with product code 'P980 to 1%. h. Remove the customer with id 'C009. (6 marks) (4 marks)

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions