Академический Документы
Профессиональный Документы
Культура Документы
Class 12
23-7-2014
1.
Time : 1 hr.
M. Marks : 20
Let us assume a Multiplex Cinema Theatre with a capacity of 200 viewers per theatre and
4 theatres in all. It books tickets on either phone or at the counter where people come to buy
tickets for any of the four movies.
Following tables are created to keep the booking details of customer.
Table: CUSTOMER
Booking_Code
Customer_Name
No_of_tkts
BClerk_Code
B001
Veer
4
BC005
B002
Milan
2
BC004
B003
Jahmu
3
BC003
B004
Michal
20
BC002
B005
Meera
5
BC001
Table: BCLERK
BClerk_Code
BC001
BC002
BC003
BC004
BC005
Name
Varsha
Richeal
Vineet
Payal
Nisha
[2]
[2]
[2]
Write SQL commands for the statements (i) to (vi) and give output for SQL queries (vii) to (x) on
the basis of the table shop.
Table : Shop
No.
Shop_name
Sale
Area
1
2
3
4
5
6
7
8
West side
Pantaloons
Sirs &Hers
Sports King
Biswas stores
Big Bazaar
Levis
Peter England
250000
500000
300000
380000
456000
290000
230000
428000
West
South
North
North
East
South
East
South
I.
II.
III.
IV.
V.
VI.
VII.
VIII.
IX.
X.
Cust_percentage
68.6
81.8
79.8
88.0
92.0
66.7
50.0
90.0
Rating
C
A
B
B
A
A
C
A
City
Delhi
Chennai
Amritsar
Baroda
Delhi
Kolkata
Jamshedpur
Chennai
To display the name of all shops which are in Area South and sale more than
average sales.
To display shop name and Customer Percentage of all the shops having
cust_percentage more than 77 and less than 90.
To display Maximum and Minimum Sales made for each city in ascending order
of city.
To display the city along with sum of sale for each city.
Display total sales made for each city and each area.
Display total no of sales made for same city other than Delhi.
Select min(Sale) from SHOP where Sale>300000.
Select count(Distinct City) from Shop;
Select Avg(Sale) from Shop where Area=South;
Select Max(Cust_percentage), sum(Sale) from shop where Rating=C;
[1]
[1]
[1]
[1]
[1]
[1]
[]
[]
[]
[]
Class 12
3.
-2-
Informatics Practices
Write the SQL command to create the TEACHER table including its constraints.
Table : TEACHER
Column Name
TNO
TNAME
TADDRESS
SALARY
Data Type
CHAR
VARCHAR
VARCHAR
DOUBLE
4.
Write
I.
II.
III.
5.
Size
4
20
25
7, 2
[2]
Constraint
PRIMARY KEY
NOT NULL
Model
ModelNo DispID
T020
1
M032
4
M059
2
A167
3
T024
1
ModelCost
2000
2500
7000
800
1200