0% found this document useful (0 votes)
17 views1 page

WK2 XII Cs Mysql Joins

The document provides sample data for two tables - CLUB and BOOK, and lists SQL queries that can be run on the tables. The CLUB table contains coach details like ID, name, age, sport, date of application, and pay. The BOOK table contains book details like book number, name, type and the MEMBER table contains member details like member number, name, book code, issue date. It then lists 10 queries to run on the CLUB table and 5 queries to run on the BOOK and MEMBER tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

WK2 XII Cs Mysql Joins

The document provides sample data for two tables - CLUB and BOOK, and lists SQL queries that can be run on the tables. The CLUB table contains coach details like ID, name, age, sport, date of application, and pay. The BOOK table contains book details like book number, name, type and the MEMBER table contains member details like member number, name, book code, issue date. It then lists 10 queries to run on the CLUB table and 5 queries to run on the BOOK and MEMBER tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Worksheet for XII_Cs

Write SQL commands to create the table CLUB(primary key –Coach_id) and also write queries for (i) to x) on
the basis of the tables CLUB.
Coach_Id CoachName Age Sports DateofApp Pay
1 Mr. KUKREJA 35 KARATE 27/03/1996 10000
2 Ms.RAVINA 34 KARATE 20/01/1998 15000
3 Mr. KARAN 34 SWIMMING 19/02/1998 12000
4 Mr. TARUN 33 TENNIES 01/01/1999 16000
5 Mr.ZUBIN 36 SWIMMING 24/02/1999 17000
6 Ms. RUBINA 36 TENNIES 20/02/1999 18000
7 Ms. MAMTA 39 CRICKET 01/01/2001 16000
8 Ms. ZEBA 37 CRICKET 10/10/2001 12000
9 Mr. KUSH 41 KARATE 10/10/2002 15000
10 Ms. HUMA 33 SWIMMING 11/10/2003 17000
1) To show all information about the swimming coaches.
2) To show all information about female coaches in Swimming sport.
3) To display all a report showing coachname, pay age,and bonus(10% OF Pay) for all coaches.
4) To display the coach name those are joined in the year 1999
5) To display the seniority wise list in each sports
6) To reduce the pay by 500 for cricket coaches
7) To display all details having last 4 character in their name
8) To Display the total pay of all coaches sports wise
9) To Display the youngest coach.
10) To display all elder coach in each sports

Q2) Write the Sql quries for (i) to (v) and find outputs for (vi) to(viii) which are bases on the table BOOK.(write
command to create table book and Member with primary key and foreign key)

Table : BOOK
Bno Bname Type
F101 The priest Fiction
L102 German Easy Literature
C101 Tarsan in the lost world Comic
F102 Untold Story Fiction
C102 War heroes Comic

Table : Member
Mno Mname Code Issuedate
M101 Raghav L102 13-10-2016
M103 Sarthak F102 23-02-2017
M102 Anisha Khan C101 12-06-2016

i) To display all details from the Member in descending order of Issuedate.


ii) To display the Bno and Bname of all Fiction type books.
iii) To display the Type and number of book in each Type
iv) To display all the Mname and Issuedate of those members who have books issued in
year 2017
v) To display all Bname and mname of those issued a book.
vi) Select Max(Issudate) from Member;
vii) Select Bname from Book where Type not in(“Fiction”,”Comic”);
viii) Select Type , count(*) from BOOK group by Type not having count(*)>1

You might also like