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

sql-1

The document outlines the creation of various SQL tables including Product, Client, Activity, Coach, Customer, Bill, Books, and Issues, along with specific queries to manipulate and retrieve data from these tables. It includes tasks such as adding records, displaying information based on conditions, and performing calculations like averages and sums. Each section is dated and specifies the required SQL commands for different operations related to the respective tables.

Uploaded by

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

sql-1

The document outlines the creation of various SQL tables including Product, Client, Activity, Coach, Customer, Bill, Books, and Issues, along with specific queries to manipulate and retrieve data from these tables. It includes tasks such as adding records, displaying information based on conditions, and performing calculations like averages and sums. Each section is dated and specifies the required SQL commands for different operations related to the respective tables.

Uploaded by

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

PRACTICAL INDEX

S.NO. Description Date Sign


5. Create a table Product with following structure: P_ID
char (4) primary key, ProductName varchar (12), 21.04.2025
Manufacturer char (3), Price integer, ExpiryDate date.

1. Add 5 records
2. Write queries to do the following:
2.1 To display ProductName,
Manufacturer, ExpiryDate for all products
that expired on or before ‘2010-12-31’
2.2 To display all records with
Manufacturer starting with ‘L’.
2.3 To display all records in descending
order of price.
2.4 To display number of unique
ProductName existing in the table.
2.5 To display average of price, minimum
price, maximum price and count
ProductName wise
2.6 Increase price of products by 10%.
6. Create a table Client with following structure: C_ID
integer (Primary Key), ClientName varchar(15),City 22.04.2025
varchar(10),P_ID char(4). Write queries to do the
following:

1. To display C_ID, ClientName, City and


ProductName for all Clients residing in Delhi.
2. To add a field Balance Numeric(8,2) with a
default value 12000.
3. To show C_ID, ClientName and Monthly
Balance(Balance/12).Using aliasing for
MonthlyNbalance.
4. To show records of all clients with ClientName
consisting of 4characters.
5. Delete all records of clients with
City=”Bengaluru”
7. Create the tables ACTIVITY and COACH. Write SQL
commands for the statements (i) to (v): 23.04.2025
i. To display the name of all activities with their
Acodes in descending order.
ii. To display sum of PrizeMoney for each of the
Number of participants groupings (as shown in
column ParticipantsNum 10,12,16)
iii. To display the coach’s name, Activity name and
ACodes from the table COACH and ACTIVITY iv.
To display the content of the GAMES table whose
ScheduleDate earlier than 01/01/2004 in
ascending order of ParticipantNum.
v. To display Maximum Schedule date and
Minimum Schedule date from table Activity.
8. Create the tables Customer and Bill. Write SQL
commands for the statements (i) to (v): 24.04.2025
i. Display a report containing cust_id,
cust_name, Item, qty, price and bill amount. Bill
amount is calculated as the sum of qty*price. ii.
Display how many customers have ordered Pizza
in the month of August. iii. Display the name of
customer along with their city in alphabetical
order of city.
iv. Insert into table customer a column City and
enter Delhi to all of them.
v. To display how many clients are there in each
city.
9. Create the tables BOOKS and ISSUES and write the
SQL commands for (i) to (v): 25.04.2025

i. To show Book name, Author name and Price


of books of ABC publisher.
ii. To display the details of the books in
descending order of their price. iii. To
decrease the Qty_Issued from ISSUES table by
3 (all rows must decrease).
iv. To display the Book Id, Book name, Publisher,
Price, Qty, Qty_Issued from both the tables
with their matching Book ID.
v. To display the Price of Books where Quantity
Issued is equal to 5.
QUESTION 5
Code and output
Question 6
Code and output
Question 7
Code and output
Question 8;
Code and output
Question 9
Code and output

You might also like