Professional Documents
Culture Documents
PRACTICAL FILE
Subject: DBMS
(21-25)
ASSIGNMENT-1
Q1. Create the tables described below:
Q6: Exercise on deleting the table structure along with its data.
a) Destroy the table ‘Client_Master’ along with its data.
b) Destroy the table ‘Product_Master’ along with its data.
c) Destroy the table ‘Sman_Mast’ along with its data.
ASSIGNMENT-2
Solution:
Q1 (a-d)
Q1(e-f):
Q2 (a-c):
Q3 (a-c)
Q4 (a):
Q4 (b):
Q5:
Q6 (a-c):
ASSIGNMENT 3
Q1. Create the following tables :
Q2. Insert the following values into the tables :
ASSIGNMENT-3
Solution:
Creating tables:
Client Master and Product Master
Salesman Master Table
Inserting values:
Client Master Table
ASSIGNMENT 4
(SQL OPERATORS AND FUNCTIONS)
1. Generate the SQL statements to perform the following computations
on table data:
a. List the names of all clients having ‘a’ as the second letter in their
names.
b. List the clients who stay in a city whose first letter is ‘M’.
c. List all clients who stay in ‘Bangalore’ or ‘Mangalore’.
d. List all clients whose BalDue is greater than value 10000.
e. List all information from the Sales_order table for order placed in the
month of June.
f. List the order information for ClientNo ‘C00001’ and ‘C00003’.
g. List products whose selling price is greater than 500 and less than or
equal
to 750.
h. List products whose selling price is more than 500 with the new selling
price calculated as, original selling price plus 15%. Rename the new
column
in the output of the above query as new_price.
i. List the names, city and state of clients who are not in the state of
‘Maharashtra’.
j. Count the total no. of orders.
k. Calculate the average price of all the products.
l. Determine the maximum and minimum product prices. Rename the
output
as Max_Price and Min_Price respectively.
m. Count the no. of products having price less than or equal to 500.
n. List all the products whose Qtyonhand is less than reorder level.
2. Exercise
a. List the Order No & day on which clients placed their order.
b. List the month (in alphabets) and date when the order must be
delivered.
c. List the order date in the format ‘DD-Month-YY’ e.g. ’24-February-14’.
d. List the date, 15 days after today’s date.
ASSIGNMENT-4
Solution:
Q1 (a-h):
Q1 (i-n)
Q2 (a,b):
Q2 (c,d):