0% found this document useful (0 votes)
14 views6 pages

Grade 12 SQL Practical Record

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)
14 views6 pages

Grade 12 SQL Practical Record

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/ 6

SQL Queries for Practical Record

16. Consider the following MOVIE table and write the SQL queries based on it.

11-11-2024

a) Display all information from movie.

b) Display the type of movies.

c) Display movie id, movie name, total_earning by showing the business done by
the

movies. Calculate the business done by movie using the sum of production
cost and

business cost.

d) Display movie id, movie name and production cost for all movies with
production cost
greater than 150000 and less than 1000000.

e) Display the movie of type action and romance.

f) Display the list of movies which are going to release in February, 2022.

17. Consider the given table Patient and Write the following queries: 12-11-

2024

a) Display the total charges of patient admitted in the month of November.


b) Display the eldest patient with name and age.
c) Count the unique departments.
d) Display an average of charges.
18. Suppose your school management has decided to conduct cricket
matches between students of Class XI and Class XII. Students of each class are
asked to join any one of the four teams – Team Titan, Team Rockers, Team
Magnet and Team Hurricane. During summer vacations, various matches will be
conducted between these teams. Help your sports teacher to do the following:
14-11-2024
a) Create a database “Sports”.
b) Create a table “TEAM” with following considerations:
a. It should have a column TeamID for storing an integer value between 1
to 9, which
refers to unique identification of a team.
b. Each TeamID should have its associated name (TeamName), which
should be a
string of length not less than 10 characters.
c. Using table level constraint, make TeamID as the primary key.
c) Show the structure of the table TEAM using a SQL statement.
d) As per the preferences of the students four teams were formed as given
below. Insert
these four rows in TEAM table:
a. Row 1: (1, Titan)
b. Row 2: (2, Rockers)
c. Row 3: (3, Magnet)
d. Row 4: (4, Hurricane)
e) Show the contents of the table TEAM using a DML statement.
f) Now create another table MATCH_DETAILS and insert data as shown below.
Choose
appropriate data types and constraints for each attribute.
Write following queries using Joins:

a) Display the matchid, teamid, teamscore who scored more than 70 in first
inning along with team name.

b) Display matchid, teamname and secondteamscore between 100 and 160.

c) Display matchid, teamnames along with matchdates.

d) Display unique team names.

e) Display matchid and matchdate played by Rockers and Magnet.

19. Consider the following table and write the queries: 18-11-2024

a) Display all the items in the ascending order of stockdate.


b) Display maximum price of items for each dealer individually as per dcode from
stock.

c) Display all the items in descending orders of itemnames.

d) Display average price of items for each dealer individually as per dcode from
stock which

average price is more than 5.

e) Diisplay the sum of quantity for each dcode.

20. Write a MySQL connectivity program in Python to 20-11-2024


 Create a database school
 Create a table students with the specifications - ROLLNO integer, STNAME
character(10) in MySQL and perform the following operations:
o Insert two records in it
o Display the contents of the table
21. Perform all the operations with reference to table ‘students’ through
MySQL Python connectivity.
22. Write a menu-driven program to store data into a MySQL database named
Shop and table Customer as following:

1. Add customer details

2. Update customer details

3. Delete customer details

4. Display all customer details

Note:- The attributes in the table Customer are cid, cname, city, bill_amt,
category

You might also like