[go: up one dir, main page]

0% found this document useful (0 votes)
44 views9 pages

SQL A

The document discusses creating and populating Cricket and Students tables in SQL and then performing various queries on the tables including listing data, filtering by conditions, sorting results, and joining tables.

Uploaded by

Payal Godara
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)
44 views9 pages

SQL A

The document discusses creating and populating Cricket and Students tables in SQL and then performing various queries on the tables including listing data, filtering by conditions, sorting results, and joining tables.

Uploaded by

Payal Godara
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/ 9

 Create the following tables in sql: i.Cricket and ii.

Students
1. Cricket

Match played (Mno) Tournament(tname)


10 Chandigarh
15 Noida
20 Chennai
25 Mumbai
30 Delhi

2. Students

Rno. first_name last_name Address Age Score Mno


1 Dhruv Rathi Saket 17 360 15
2 Sahil Rawat Gurgaon 18 500 20
3 Sachin Tanwar Dwarka 20 600 30
4 Tushar Yadav Rangpuri 18 250 20
5 Ankit Kaushik Gurgaon 16 230 10
6 Aman Yadav Rajokari 18 560 25
7 Harsh Sharma Gurgaon 19 750 30
8 Garv Rao Dwarka 17 320 20
9 Himanshu Yadav Saket 19 450 25
10 Rahul Godara Saket 18 400 20

Solution

1.

2.
 Insert records in the above tables.

Solution

1.

2.
 List all information about all players from student table.

Solution

 List all the information about matches from cricket table.

Solution
 List all player names along with their ages from student table.

Solution

 List the last name of student who played 30 matches.

Solution
 List the first name of players who are 19 and 20 years old.

Solution

 List the names of players who are not 18 years old.

Solution

 List the players name and score , whose score is between 300 and 700.

Solution
 List the players names having ‘A’ as the second character.

Solution

 List the players who played 20 matches and scored more than 350.

Solution

 List the match played, first name, score in ascending order of name of first name.

Solution
 List the details of all players residing in Gurgaon.

Solution

 List the maximum score of player who played 20 matches.

Solution

 List the average score of players who played 30 matches.

Solution

 List the total score scored by players.

Solution
 List the average number of players who played 20 matches.

Solution

 List the details of all players residing in Gurgaon and score more 300.

Solution

 List the players who played matches in Mumbai.

Solution
 Write a query to perform left & right join on two tables to display the last name & age .

Solution

You might also like