Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
50% found this document useful (2 votes)
2K views

SQL Mandatory Assignment 1

The document describes a sales order processing system for a fashion retailer. It provides the problem statement and details on salesman, customer, and orders tables. It lists tasks to insert new records, add constraints, fetch data matching certain criteria, use set operators to find unique and duplicate records, and perform a right join.

Uploaded by

Mona Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
2K views

SQL Mandatory Assignment 1

The document describes a sales order processing system for a fashion retailer. It provides the problem statement and details on salesman, customer, and orders tables. It lists tasks to insert new records, add constraints, fetch data matching certain criteria, use set operators to find unique and duplicate records, and perform a right join.

Uploaded by

Mona Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SQL Mandatory Assignment 1

Contact us: support@intellipaat.com / © Copyright Intellipaat / All rights reserved


Problem Statement:

ABC Fashion is a leading retailer with a vast customer base and a team of dedicated sales
representatives. They have a Sales Order Processing System that helps manage
customer orders and interactions.

Dataset:

Find the below information and the script for the table creation and record insertion.
https://docs.google.com/document/d/1ngN7Q0Mpo8j5BXidNHGRHmgbMSuG5XcFYnp_gD3woL
A/edit?usp=sharing

Salesman Table:

Customer Table:

Orders Table:

Contact us: support@intellipaat.com / © Copyright Intellipaat / All rights reserved


Tasks to be Performed:

1. Insert a new record in your Orders table.


2. Add Primary key constraint for SalesmanId column in Salesman table. Add default
constraint for City column in Salesman table. Add Foreign key constraint for SalesmanId
column in Customer table. Add not null constraint in Customer_name column for the
Customer table.
3. Fetch the data where the Customer’s name is ending with ‘N’ also get the purchase
amount value greater than 500.
4. Using SET operators, retrieve the first result with unique SalesmanId values from two
tables, and the other result containing SalesmanId with duplicates from two tables.
5. Display the below columns which has the matching data.
Orderdate, Salesman Name, Customer Name, Commission, and City which has the
range of Purchase Amount between 500 to 1500.
6. Using right join fetch all the results from Salesman and Orders table.

Contact us: support@intellipaat.com / © Copyright Intellipaat / All rights reserved

You might also like