50% found this document useful (2 votes)
499 views

SQL Mandatory Assignment 1

The document describes tasks related to a sales order processing system for a retail company. It includes creating tables, inserting records, adding constraints, joining tables, and filtering results.

Uploaded by

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

SQL Mandatory Assignment 1

The document describes tasks related to a sales order processing system for a retail company. It includes creating tables, inserting records, adding constraints, joining tables, and filtering results.

Uploaded by

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

t

aa
llip
SQL Mandatory Assignment 1
te
In

Contact us: [email protected] / © 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

t
aa
Salesman Table:
llip
Customer Table:
te
In

Orders Table:

Contact us: [email protected] / © 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.

t
5. Display the below columns which has the matching data.

aa
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.
llip
te
In

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved

You might also like