0% found this document useful (0 votes)
7 views

Holiday Homework Computer Science Part1

Uploaded by

ronakahuja2019
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Holiday Homework Computer Science Part1

Uploaded by

ronakahuja2019
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Q1.

Create a database with your name, list all the databases and
open the database with your name

Client Table
Q2.Create the following table using SQL statements. And also show
its structure:
Field name Data Type Attribute
Clientno Char(6) Primary Key
Name Varchar(20) Not Null
City Varchar(50) Not Null
Pin Number
Mobile Char(10)
Q3.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 9090868765
C00004 Ravi Shreedharan Delhi 110020 8727121232
C00005 Rukmani Kolkata 340003 2312376543
C00006 Pradeep Jaipur 130102 1222132333
Singhania
C00007 George Paul Kolkata 340010 3323211232
C00008 D Ravichandran Bombay 400014 2212387896
Q4.List records of all clients who are not from Bombay

Q5.Display Different cities .

Q6. Delete the details of a client whose name contain ‘van’

Q7.Delete client table.


Q8.Create a table ‘Club’ with proper Integrity constraints and
insert data as given below:

Note:
 coachid as primary key
 Coachname unique
 Age not null
 Pay should be greater than 0
 Sports not null
 Gender default gender M

Q9.Display information about coaches whose name starts


with K or pay is at least 1500 or both.

Q10.Write a query to display a report showing coachname,


pay, age and bonus (15% of pay) for all coaches.
Q11.Display information about all male coaches.

Q12.Find the min, max, sum, and average of the pay in a club
table

Q13.Find the total number of coaches from each sport using


group by.
Q14.Write command to display the output as

Q15.Consider the following table Movie and display all


movies which fall in the category of Comedy or Action.
Q16.Consider the table Movie and display all movies which
have not been released yet.

Q17.Consider the table Movie and display net profit of each


movie showing its ID, Name and Net Profit. (Hint: NetProfit =
BusinessCost –ProductionCost)

Q18.Write a query to extract the record of the latest movie


released.

Q19.Write a query to update business cost by 15%.


Q20.Write the output of the following query (Select
MovieiID, MovieName from Movie where Movieid in
(005,006)

Q21.Consider the following table ‘Stock’ and display all


items which name begins with ‘s’ in descending order of rate
Q22. Consider the table ‘stock’ and list item name and quantity
which rate lies between 50 to 100 rupees.

Q23 a)Consider the following tables –Product and Supplier:


Table :Product

Table :Supplier

Q24.Write a query to join two tables product and supplier on


the basis of sid column.
Q25.Write a Query to find the cartesian Product or cross join
of Product and Supplier table.

Q26.Write a query to find pname,sid, sname who have


matching sid .
Q27.Write a query to add one more column in product table
name qty integer type.

Q28.Write a query to rename column pname as prodname.

Q29.Write a query to delete sname column from table


supplier

Q30.Write a query to change pname ball with the ball pen.


Q31.What will be the output of the following statement?
Select * from product natural join supplier.

You might also like