The Emirates National School - Sharjah Informatics Practices Worksheet Grade 12 (2024-'25) - Review of Database Concepts and SQL

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

The Emirates National School – Sharjah

INFORMATICS PRACTICES WORKSHEET


Grade 12 (2024-’25)
Chapter 3 – Review of Database Concepts and SQL
1. Write SQL command to create the table STUDENT with the given specifications:

Field Datatype Constraint


No Int(3) Primary Key
Name Varchar(20) Not Null
Fee Decimal(6,2)
Stream Varchar(20)
AvgMark Decimal(4,1)
Grade Char(1)
Class Char(3)

2. Write MySQL command to add the given records into the table STUDENT

No Name Fee Stream AvgMark Grade Class DOB


1 Karan 400.00 Medical 78.5 B 12B 1994-03-17
2 Divakar 450.00 Commerce 89.2 A 11C 1995-02-12
3 Divya 300.00 Commerce 68.6 C 12C 1994-05-16
4 Arun 350.00 Humanities 73.1 12C 1994-10-16
5 Sabina 500.00 NonMedical 90.6 A 11A 1994-08-01
6 John 400.00 Medical 75.4 B 12B 1995-03-17
7 Robert 250.00 Humanities 64.4 11A 1995-11-17
8 Rubina 450.00 NonMedical 88.5 A 12A 1994-01-31
9 Vikas 500.00 NonMedical 92.0 A 12A 1994-07-27
10 Mohan 300.00 Commerce 67.5 C 12C 1994-06-16
3. Write MySQL commands for the following:

1) Display all the records in the given table.


2) Display the name, stream and average marks of all students.
3) Display the list of students in the Commerce stream
4) List the students who are in Class 11.
5) Display the name and fee of those students whose average marks is below 70.
6) Display the different streams mentioned in the given table.
7) Display the names of those students whose average marks are in the range 70 to
80 (both inclusive)
8) Display the details of students in the nonmedical stream who are in grade 12
9) Display the details of students who opted for commerce or humanities stream.
10) Display the names of those students whose fee is less than 400
11) Display the name and stream of those students either securing Grade A or are in
the Commerce stream.
12) Display the names of students in the alphabetic order.
13) List the details of those students whose name starts with the letter ‘D’
14) Display the name, stream and grade of those students who have exactly 5 letters in
their name.
15) Display the No, name, and class of those students whose name ends with the letter
‘a’.
16) Display the name and stream of students whose grade is not known
17) Increase the fees of all medical students by 10%
18) Delete the records of those students in the humanities stream.
19) Add another column gender with appropriate data type.
20) Change the data type of column Fee to integer.

You might also like