Write and run the following queries for your database using SQL commands:
1. List all the customers whose pin code is “1100067”.
2. List the order id and amount of those orders which are placed in first week of the month and are of
amount more than 10,000.
3. List the customer name and contact number of those customers who have placed more than one
order in October 2023.
4. List the customer details, who has placed their orders on 10-10-2023.
5. List all the customers whose name starts with alphabet ‘A’.
10
6. Find the total price of the order id O0011 .
7. List the electronic products information in the increasing order of price.
8. Find the detail of products which have been ordered more than once.
9. ist the order details of the orders placed on 11-10-2023 and payment mode is COD.
10. List the different types (such as electronic, grocery, cloth etc.) of items available for shopping.
To address these queries, let's assume we have a database with the following structure:
-
Customers table:
customer_idcustomer_namecontact_numberaddresspin_code
-
Orders table:
order_idcustomer_idorder_dateamountpayment_mode
-
OrderDetails table:
order_idproduct_idquantityprice
-
Products table:
product_idproduct_namecategoryprice
Here are the SQL queries based on the specified requirements:
- List all the customers whose pin code is “1100067”.
To address these queries, let's assume we have a database with the following structure:
-
Customers table:
customer_idcustomer_namecontact_numberaddresspin_code
-
Orders table:
______ _________ ___ _____ __________ ____ _________.
________ _____ _____ _________ ____ _________ _____.
_______ _______ ________ ________ _____ __________ __________ ___ _____ ___ _________ ____.
_____ ________ _______ ________ _____ ____ _________ ___ __________.
_________ __________ _______ ______ ______ _________ _________ ___ _______ ______ ______ _________.
___ ____ _______ _________ ______ _______ _______ ______ _____ ____ ___.
_____ ______ _______ ________ _____ ______ __________.
_____ ______ _______ ______ _________.
_______ ________ ____ _________ ___.
___ __________ _________ ____ ____ __________ ________ ___ _______.
___ ___ ______ ____ _____.
______ ___ ____ ___ ______ ________.
_____ _______ ___ ______ _________ ___ ________ ____ ________ __________ _________.
______ _______ ____ ____ _________ _____ ______.
___ __________ ___ _____ ___ __________ __________ ________ ________.
__________ _________ ________ _______ ________ _____.
______ ______ _________ ____ _______ _______ _______ __________ _______ ________ _________ _________.
____ ______ _______ ______ ______ ________ __________ ________.
___ ____ ___ _________ ____ ________ __________ __________ _______ _________ _____.
__________ ______ _________ _____ _______.
_____ ________ __________ _______ _________ ________ ____ ___ __________ ______ __________ _______.
__________ _______ _____ ___ _____ ________ ____ ______ _____ ___ ____ __________.
____ ______ _______ __________ _________ _______ __________.
________ ______ ________ ______ ______ _____ ____ ________ _____ _________ _____ _________.
___ ______ _________ _______ ____ ________ __________ ______ ________ __________ _____ _________.
_______ ________ ________ ____ _________ ______ _________ ______ ________ ________ ______ _______.
_____ _____ ___ _________ __________ ______ ____ ________ ________ _________ _____ ______.
_____ ____ _______ _______ _______ ________ _______ ____ __________ __________ ___ _____.
_________ _________ ________ _____ __________ ____ ____ ___.
___ ____ ______ __________ _____.
_________ ________ ______ __________ ___ ___ ______ ________ __________ _______.
___ _____ _________ ____ ______ ____ ________ _______ _______ ___ ___.
______ _________ ________ _________ ___ ______ ____.
______ ______ ___ __________ _________.
______ ___ ________ _________ _____ __________ ___ ___.
_________ ____ _____ ____ _____.
_______ ______ ___ ______ _______ __________ ______ ________ ______ _______ _______.
_____ ____ __________ __________ _________.
___ ______ ________ ____ ___ ________.
____ ________ _____ ___ _________ _______ _______ _____.
_________ ______ __________ _________ ___ ___ _________ __________.
_____ ________ __________ _______ _____ ______ ___ ________.
_________ ____ ________ _________ ____ ________.
________ ___ _____ ____ ___ _____.
___ _______ _________ ____ ___ ______ _________.
______ ___ ___ __________ ____ _____.
___ ________ ________ _______ __________ ______ _________.
_____ _______ ____ __________ _______ _______ ______ _______ ____.
_____ _________ ______ _________ __________.
_________ ___ _________ ___ _____ _______ _______ __________ __________ _________ ______.
__________ _______ _____ __________ _________ ____ _______ _________ ________.
____ ____ ______ __________ __________ _______ __________ _______.
__________ ___ ________ _______ _______ ______ _________ _____.
_______ __________ ______ _____ _______ _______ __________ ___ _____ _______.
_________ ______ _____ _______ __________ _______ _____ _________ ________ _____ ______ _____.
_______ ___ __________ ____ ____.
_____ ______ ____ ________ _____ _____ ________ ________.
________ ___ ________ _________ ____ ________ ____ ___ ___ _________ _______.
___ ______ _____ _______ ______.
___ _____ _______ __________ ____ ________ ________.
_____ _______ ___ _________ ____ _____ ___ _________.
__________ ________ ___ __________ ____ ________ ___ ________.
______ _______ ________ ___ __________ ________ ________ ___ _____ ______ __________ _________.
_________ ___ ________ ____ __________ ________ ___ _________ ________ __________.
______ _________ ______ _______ _____ __________.
Get Full Answer on WhatsApp