You are on page 1of 7

Practical Questions SQL Based

A)Create table books with appropriate data type –

B) Insert record (‘K01’,’Black book(Java)’,’FIRST


PUBL’,600,’Computer’,60)

C) Add a new column author-

D)Update author name ‘Y.Kanatkar’ for B_id ‘K01’-

E) Show books of FIRST PUBL –

F) To display the cost of all book published by ‘EPB’-

G) Depriciate the price of all books of EPB Publisher by10 %-


H)To display the Book_name , Price of book more than 24 Qty-

I) To show the details of book whose name ends with ‘e’-

J) To display all records in descending order by price-

2) Consider the following tables and give the answers of the following Questions:
Stock Table
Order_ID Item_Name Qty Price
O200 Ball pen 100 10
O201 Gel Pen 150 15
O203 Eraser 125 5
O204 Pencil 200 7
O205 Ruler 100 5
Customer table

Cust_ID NAME Order_ID


S101 Rahul O200
S102 Sumit O201
S103 Shobhit O203
S104 Manmeet O204
Write Queries for the following Questions:

a) To display the details of those items whose Order id is O203 or Quantity is


more than 100.
b) To display total unit price of each items

c) To display total revenue for all the items

d) To display details of all items in the stock table in ascending order of item
name.

e) To display Quantity and item name of those item whose unit price is more than
10.

f) To Display Customer name, Item name and Price for all items.
g) To Display Customer id, Customer name, Item name from the given table.

h) To Display Customer name, Item name of those items whose Quantity is more
than 10.

i) To Display Order id ,Price from the Stock table.

j) Display all details of the Customer table.


3) Create a below given Student Table
Roll_no Stu_Name Class Sections Marks
101 Rohit 10 A 412
102 Alok 10 A 526
103 Roohi 9 B 427
104 Alka 10 B 500
105 Rahul 9 A 226
a) Create a table with appropriate data types.

Description of table

b) Insert data in the student table

c) Display all data


d) Delete the details of a particular student in the above table.

e) Display the Student name in uppercase, class and marks from the given table.

You might also like