SQL Exercise 1
SQL Exercise 1
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)
Practical 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
Practical 3: Display the name of those clients whose name contains ‘van’ (refer table ‘Client’ of Practical
2)
Practical 4: List records of all clients who are not from Bombay. (refer table ‘Client’ of Practical 2)
Practical 6: Create a table ‘Club’ with proper Integrity constraints and insert data as given below:
Practical 8: Write a query to display report showing coachname, pay, age and bonus (15% of pay) for all
coaches. (Refer table ‘Club’ of Practical 6)
Practical 9: Display information about all male coaches. (Refer table ‘Club’ of Practical 6)
Practical 10: Write command to display the output as (Refer table ‘Club’ of Practical 6)
Karan
Tarun
Anjani
soumya
Practical 11: Consider the following table Movie and display all movies which fall in the category of
Comedy or Action.. (NCERT Textbook)
Practical 12: Consider the table Movie of practical 11 and display all movies which have not been
released yet. (NCERT Textbook)
Practical 13: Consider the table Movie of Practical 11 and display net profit of each movie showing its ID,
Name and Net Profit.
(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?.
Practical 15: consider the table ‘stock’ of practical 14 and list item name and quantity which rate lies
between 50 to 100 rupees.