0% found this document useful (0 votes)
10 views

SQL

The document outlines an SQL assignment for MBA-BI students at Gujarat University, requiring the creation of a database and multiple tables including Client_master, Product_master, Salesman_master, and Sales_order. It includes tasks such as inserting records, retrieving data, filtering clients, and modifying table structures. The assignment emphasizes practical SQL skills through various queries and data manipulations.

Uploaded by

hetanshi rana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

SQL

The document outlines an SQL assignment for MBA-BI students at Gujarat University, requiring the creation of a database and multiple tables including Client_master, Product_master, Salesman_master, and Sales_order. It includes tasks such as inserting records, retrieving data, filtering clients, and modifying table structures. The assignment emphasizes practical SQL skills through various queries and data manipulations.

Uploaded by

hetanshi rana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Gujarat University

Department of Business Intelligence


Fundamentals of SQL Assignment
NAME: Rana Hetanshi
CLASS: MBA-BI SemII
ROLL NO.: BI-27
1) Create database with your name and roll number. (e.g., DBI_D02_ABC).
2) Create following listed tables.
Table – 1 : Client_master
Column Name Data Type Size
Client_no Varchar 6
Name Varchar 20
Ciy Varchar 15
Pincode Numeric 8
State Varchar 15
Bal_due Numeric 10,2

Table – 2 : Product_master
Column Name Data Type Size
Product_no Varchar 6
Description Varchar 15
P_percent Numeric 4,2
U_measure Varchar 10
Qty_on_hand Numeric 8
Reorder_lvl Numeric 8
Sell_price Numeric 8,2
Cost_price Numeric 8,2

Table – 3 : Salesman_master
Column Name Data Type Size
S_no Varchar 6
S_name Varchar 20
City Varchar 20
Pincode Numeric 8
State Varchar 20
Sal_amt Numeric 8,2
Tgt_to_get Numeric 6,2
Ytd_sales Numeric 6,2
remarks Varchar 12

Table – 4 : Sales_order
Column Name Data Type Size
Order_no Varchar 6
Order_date Date
Client_no Varchar 6
S_no Varchar 6
Dely_type Char 1
Billed_yn Char 1
Dely_date Date
Order_status Varchar 10

3) Insert at least 5 records in each table.


4) Retrieve all the records from all the tables.

5) List all the clients who are located in Bombay.

6) Find the names of the salesman who have a salary equal to Rs. 3000
7) Delete from client_master where the column state holds the value ‘Tamil Nadu’.

8) Add a column called ‘telephone’ of datatype ‘number’ and size=10 to the


client_master table.

9) Change the size of sell_price column in product_master to 10,2.

10) Rename column telephone to new name as contact for client_master table.
11) Find the name of all clients having ‘a’ as the second letter in their names.

12) Find products whose selling price is greater than 2000 and less than or equal to
5000.

13) Determine the maximum and minimum product prices. Rename the output as
max_price and min_price respectively.
14) Change the city of client_no’C002’ to ‘Bombay’.

15) Change the bal_due of client_no’C001’ to Rs.1000.

16) Change the cost price of Floppies to Rs. 950.00.

17) Change the city of the salesman to Mumbai.


18) Display the month (in alphabets) and date when the order must be delivered.

19) Find out the name of city whose second last character is ‘a’.
20) Find products whose selling price is more than 1500. Calculate a new selling price
as, original selling price * .15. Rename the new column in the above query as
new_price.

You might also like