0% found this document useful (0 votes)
2 views11 pages

Create a Table Product With Following Structure

The document outlines the creation and manipulation of several database tables including Product, Client, Activity, Coach, Customer, Bill, Issues, and Books. It includes instructions for inserting records, displaying specific data based on conditions, updating prices, and deleting records. Additionally, it provides queries for aggregating and sorting data across these tables.

Uploaded by

f20240841
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views11 pages

Create a Table Product With Following Structure

The document outlines the creation and manipulation of several database tables including Product, Client, Activity, Coach, Customer, Bill, Issues, and Books. It includes instructions for inserting records, displaying specific data based on conditions, updating prices, and deleting records. Additionally, it provides queries for aggregating and sorting data across these tables.

Uploaded by

f20240841
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

1.

Create a table Product with following structure:


P_ID CHAR(4) PRIMARY KEY, PRODUCTNAME
VARCHAR(12), MANUFACTURER CHAR(3), PRICE
INTEGER, EXPIRYDATE DATE.

1. Add 5 records

1. to display productname, manufacturer,expirydate for all products that expired on


or before ‘2010-12-31’
2. Displaying records where manufacturer starts with L

3. To display records in descending order of price

4. To display no. of unique product names

5. To display average, minimum, maximum price and count grouped by product


(iii) To increase price of all products by 10%

2. Create a Table Client

1. Insert 5 records
2. To display C_Id, Client Name, City, Product Name for clients in Delhi

3. To add a field Balance (8,2) with default value 12000


4. To show records of clients where clientname has exactly 4 letters

5. To delete all records where city is Bengaluru

3. Create 2 Tables activity and coach


1. To display names of activities in descending order of their ACode

2. To display total prize money for records grouped by no. of participants

3. To display coach’s name, activity name, ACode from the two tables

4. To display details of games where schedule date is before 1-1-2004, order by


participants num
5. To display maximum and minimum date of activities

4. Create the tables customer and Bill:


1. Display cust_id, cust_name, Item, qty, Bill amount where bill amount is qty
multiplied by price

2. To display how many customers ordered pizza in August

3. To display number of customers along with their city in alphabetical order of city

4. Insert column city and enter all as delhi


5. To display how many clients are there in each city

5. Create tables Issues and Books and run the following queries
1. To show bookname, author names and price of books of ABC publisher

2. To display details of books in decreasing order of price

3. To decrease qty_issued by 3 for all records


4. To display the Book Id, Book name, Publisher, Price, Qty, Qty_Issued from both
the tables where Book ID is same

5. To display price of books where qty_issued=5

You might also like