Question

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.

01 Dec 2023
Answer :
Word Count : 652

To address these queries, let's assume we have a database with the following structure:

  1. Customers table:

    • customer_id
    • customer_name
    • contact_number
    • address
    • pin_code
  2. Orders table:

    • order_id
    • customer_id
    • order_date
    • amount
    • payment_mode
  3. OrderDetails table:

    • order_id
    • product_id
    • quantity
    • price
  4. Products table:

    • product_id
    • product_name
    • category
    • price

Here are the SQL queries based on the specified requirements:

  1. List all the customers whose pin code is “1100067”.

To address these queries, let's assume we have a database with the following structure:

  1. Customers table:

    • customer_id
    • customer_name
    • contact_number
    • address
    • pin_code
  2. Orders table:

    • order_id
    • customer_id
    • order_date
    • amount
    • payment_mode
  3. OrderDetails table:

    • order_id
    • product_id
    • quantity
    • price
  4. Products table:

    • product_id
    • product_name
    • category
    • price

Here are the SQL queries based on the specified requirements:

  1. List all the customers whose pin code is “1100067”.

SELECT * FROM Customers
WHERE pin_code = '1100067';

  1. List the order id and amount of those orders which are placed in the first week of the month and are of amount more than 10,000.
 SELECT order_id, amount FROM Orders WHERE DAY(order_date) <= 7 AND amount > 10000; 
  1. List the customer name and contact number of those customers who have placed more than one order in October 2023.
 SELECT c.customer_name, c.contact_number FROM Customers c JOIN Orders o ON c.customer_id = o.customer_id 
__________ _________ ______ _____ _____ _____ _______ _________ ___ ____ ____.
____ _______ ________ ____ ____ ________ ______ ___ ___ ___ __________ ________.
______ ___ ___ ____ _____ ____ _________ ______.
_____ ____ ________ _________ ___ ___ ______ ___ _____ _______ ____ _________.
_____ ___ _____ _______ _____ _________ __________ ____ __________ ______ ______.
_____ ____ __________ ___ _____ _______ ___ ___ ___ _______ ___ ___.
____ _______ ____ _________ _______ ________.
_____ ________ ___ ___ ______ _______ _______ ____ _____.
_______ ___ ___ _______ __________ _____ ____ _____ ________ __________.
____ ______ _____ __________ _________ ____ __________ ____ _______ _________.
__________ ___ _______ _________ __________ ___ ____.
_______ _____ _____ ______ ________ ______ _____ _____.
______ __________ ________ __________ ___ _________.
________ _____ ____ _______ _____ _______ _____ _______ ____ ______ _______.
___ _______ __________ ____ ______ ___ ________ ______.
__________ ______ _____ ________ ________ __________ _________ ________ ___ ________ __________.
___ ___ __________ _______ _______ _________ _____ __________ ___ __________ ___.
________ ____ _______ _________ _______.
_______ _____ _____ _________ ________ _____ _____.
_________ _________ ____ ____ ___ ____ _______ _______ ____ ________.
________ _________ ________ _______ ______.
_________ _____ _____ ________ _____ ___.
_________ _______ ____ ______ _________ _____ ___ ________ _________ ______ ___.
______ __________ __________ ____ _______ _______.
_____ _______ _____ ________ ________ __________ ____ _______ _____ _________ ________ ______.
___ _________ ____ ____ _________ ____.
______ _____ __________ _______ _________ __________ _________ ________ _________ __________ ___ _________.
________ ______ ________ ___ __________ _____ ________ ____ ________ _________ ___ ______.
__________ ______ __________ ___ ___ ______.
______ _____ _______ _________ _______.
__________ __________ _____ _________ ________ __________.
_______ _________ ___ ______ _____ _____ ____ _____ ____ _______ ________ ___.
_____ _________ _____ ___ ______ ______ ____ ___ _________ ____ __________ ________.
___ _____ _________ ________ _____ __________ ___ _____ __________ ___ _________ ________.
____ ____ _____ _______ ____ _____ _______.
_______ __________ ________ _____ _________.
___ _____ __________ ____ ____.
__________ ____ _____ _________ ______ ________ ___ ________ ____ _____ __________.
_______ __________ _____ ________ _____ _______ _______.
______ ___ __________ __________ ______ ______ _________ __________ _______ ______ _________.
_______ ________ _______ _____ _________ ____ _______.
_________ ______ _________ _______ _________ ____ ______ _________ ________ ___.
_________ ________ __________ ________ __________ ___ _____ ___ _________ ____ ____.
____ ______ ________ ___ _______ _______ __________ ______ _____ __________ ____.
__________ ______ _____ _____ ________ ____ ____ _____ ______ _________.
_________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCSL 210 2023 2024 - Write and run the following queries for your database using SQL comman | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→