Database Worksheet - 1 Query

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

RSK INTERNATIONAL SCHOOL (CBSE)

(SENIOR SECONDARY)
CBSE Affiliation Number 1930766
COMPUTER SCIENCE - 083
WORKSHEET
GRADE: 12 TOPIC: DATABASE - 1(QUERY)

1: Create following table using SQL statements.


Client table
Field name Data type Attributes
Clientno char(6) Primary key
Name Varchar(20) Not Null
City Varchar(50) Not Null
Pin Number
Mobile Char(10)
2: Insert and display following data in Client table (made in practical1) using SQL statements.
Client table
Clientno Name City Pin Mobile
C00001 Ivan Bayross Bombay 400054 3456212343
C00002 Vandana Saitwal Madras 780001 8976532322
C00003 Pramada Jaguste Bombay 400007 9090898765
C00004 Ravi Shreedharan Delhi 110020 8727121232
C00005 Rukmani Kolkata 340003 2312376543
C00006 Pradeep Singhania Jaipur 130102 1222132333
C00007 Geoge Paul Kolkata 340010 3323211232
C0008 D Ravichandran Bombay 400014 2212387896

3: Display the name of those clients whose name contains ‘van’ (refer table ‘Client’ of 2)
4: List records of all clients who are not from Bombay. (refer table ‘Client’ of 2)
5: Display Different cities. (Refer table ‘Client’ of 2)
6: Create a table ‘Club’ with proper Integrity constraints and insert data as given below:
Coachi Coachnam Age Sport Dateofapp Pay Gender
d e
1 Karan 35 Karate 27/03/19 10000 M
2 Ravina 34 Karate 20/01/20 12000 F
3 Kamal 34 Squash 19/02/20 20000 M
4 Tarun 33 Basketball 01/01/20 15000 M
5 Sumeru 36 Swimming 12/01/20 7500 M
6 Anjani 36 Swimming 24/02/20 8000 F
7 Shamima 37 Squash 20/02/20 22000 F
8 Soumya 30 Karate 22/02/20 11000 F

7: Display information about coaches whose name start with K or pay is at least 1500 or both.
(Refer table ‘Club’ of 6)
8: Write a query to display report showing coachname, pay, age and bonus (15% of pay) for all
coaches. (Refer table ‘Club’ of 6)
9: Display information about all male coaches. (Refer table ‘Club’ of 6)
10: Write command to display the output as (Refer table ‘Club’ of 6)

Karan
Tarun
Anjani
soumya
11: Consider the following table Movie and display all movies which fall in the category of
Comedy or Action.. (NCERT Textbook)
MovieI MovieName Category ReleaseDate Production Business
D Cost Cost
001 Hindi_Movie Musical 2018-04-23 124500 130000
002 Tamil_Movie Action 2016-05-17 112000 118000
003 English_Movie Horror 2017-08-06 245000 360000
004 Bengali_Movie Adventure 2017-01-04 72000 100000
005 Telugu_Movie Action - 100000 -
006 Punjabo_Movie Comedy - 30500 -

12: Consider the table Movie of practical 11 and display all movies which have not been
released yet. (NCERT Textbook)

13: Consider the table Movie of Practical 11 and display net profit of each movie showing its ID,
Name and Net Profit. (NCERT Textbook)
(Hint: NetProfit = BusinessCost –ProductionCost)
Make sure that the new column name is labeled as NetProfit. Is this column now a part of
the MOVIE relation. If no, then what name coined for such columns? What can you say
about the profit of a movie which has not yet released? Does your query result show profit
as zero?.
14: Consider the following table ‘Stock’ and display all items which name begins with ‘s’ in
descending order of rate
Icode Iname Brand Qty Rate
101 Soap Lux 100 34
102 Salt Patanjali 110 20
103 Sugar Annapurna 200 56
104 Coffe Nestle 60 140
105 Maggi Nestle 90 83
106 Cake Britannia 40 10
107 Biscuit Britannia 130 5
108 Musturd Oil Patanjali 75 180
109 Jam Kissan 20 54
110 Tea Brook Bond 30 160
15: consider the table ‘stock’ of practical 14 and list item name and quantity which rate lies
between 50 to 100 rupees.

You might also like