You are on page 1of 17

Practical File

In

Informatics Practices
For
Session 2021-2022

Submitted By: Guided By:


Chirag Sejwal Mr. Arvind Kr. Pandey
Class – XII H.O.D Computer Dept.
Roll No. – 14628712

Lal Bahadur Shastri School


Sector-3, R.K. Puram, New Delhi – 110022

1
INDE
S.NO Practical Description Page Teacher’s
No. Signature
01. Create a database 'School' on the 5
database server, show the list of
databases and open it.
02. Create the following table named 6
'STUDENT' with appropriate data type,
size and constraint(s) if any. Show its
table structure also.
03. insert few records/tuples into the table. 7
Verify the entered records.
04. Display all the information of students 8
whose city is NEITHER Delhi or Mumbai.
05. Display all information about class XII 9
students rank wise.
06. Display all columns arranged in 10
descending order of city and within the
city in the ascending order their marks.
07. List names of all students whose name has 11
the character ‘S’.
08. Display Name and Marks of those students 12
whose marks is in the range 430 and 470.
09. Display average marks, highest marks of 13
the students group by stream.
10. Display total no of males and females 14
separately, along with their average
marks.
11. Increase the marks of Humanities students 15
by 5% marks and verify the updated rows.
12. Add Primary key to the column Name. 16

2
Certificat
This is to certify that Chirag Sejwal, Roll No. 14628712 of Class XII
Session 2021-22 has prepared the Practical File as per the prescribed
syllabus of Informatics Practices (065), Class XII AISSCE (CBSE)
under my supervision.
It is the original work done by him. His work is really appreciable.
I wish him a very bright success.

Signature of Teacher

Signature of External

Lal Bahadur Shastri School


Sector-3, R.K. Puram, New Delhi – 110022

3
MySQL – SQL Commands

4
Practical No. 1
DATE>27/12/2021
PROBLEM:
Create a database 'School' on the database server, show the
list of databases and open it.
SOLUTION:
mysql> create database school;
> show databases;
> use school;
COMMAND & OUTPUT:

5
Practical No. 2
DATE>29/12/2021
PROBLEM:
Create the following table named 'STUDENT' with appropriate
data type, size and constraint(s) if any. Show its table
structure also.
SOLUTION:
mysql> create table student(name varchar(20),
-> class char(3),
-> sex char(1),
-> stream varchar(10),
-> city varchar(10),
-> marks int(3));
COMMAND & OUTPUT:

mysql> desc student;

6
Practical No.
DATE>30/12/202
PROBLEM
insert few records/tuples into the table. Verify the entered
records.
SOLUTION:
mysql>
INSERT INTO STUDENT VALUES('PIYUSH AGGARWAL','XII','M','HUMANITIES','DELHI','400');

ISSUED SAME COMMANDS FOR OTHER RECORDS

COMMAND & OUTPUT:

VERIFICATION:

7
Practical No.
DATE>07/01/202
PROBLEM
Display all the information of students whose city is NEITHER
Delhi or Mumbai.
SOLUTION:
mysql> select * from student where city not in(‘delhi’,’mumbai’)
-> ;
COMMAND & OUTPUT:

8
Practical No.
DATE>09/01/202
PROBLEM
Display all information about class XII students rank wise.
SOLUTION:
mysql> select * from student order by marks desc;
COMMAND & OUTPUT:

9
Practical No.
DATE>12/01/202
PROBLEM
Display all columns arranged in descending order of city and
within the city in the ascending order their marks.
SOLUTION:
mysql> select * from student order by city desc,marks;
COMMAND & OUTPUT:

1
Practical No.
DATE>14/01/202
PROBLEM
List names of all students whose name has the character ‘S’.
SOLUTION:
mysql> select name from student where name like %s%;
COMMAND & OUTPUT:

1
Practical No.
DATE>17/01/202
PROBLEM
Display Name and Marks of those students whose marks is in the
range 430 and 470.
SOLUTION:
mysql> select name,marks from student where marks between 430
and 470;
COMMAND & OUTPUT:

1
Practical No.
DATE>18/01/202
PROBLEM
Display average marks, highest marks of the students, total no.
of students group by stream.
SOLUTION:
mysql> select stream, avg(marks), max(marks), count(*)
->from student group by stream;
COMMAND & OUTPUT:

1
Practical No.
DATE>21/01/202
PROBLEM
Display total no of males and females separately, along with
their average marks.
SOLUTION:
mysql> select sex, count(*), avg(marks)
-> from student group by sex;
COMMAND & OUTPUT:

1
Practical No.
DATE>23/01/202
PROBLEM
Increase the marks of Humanities students by 5% marks and
verify the updated rows.
SOLUTION:
mysql> update student set marks=marks+(marks*0.05) where
-> stream='humanities';
COMMAND & OUTPUT:

1
Practical No.
DATE>26/01/202
PROBLEM
Add Primary key to the column ‘name’.
SOLUTION:
mysql> alter table student add primary key(name);
COMMAND & OUTPUT:

1
Bibliography
I have successfully completed my practical file with the help of my teacher.
The list of sources used is provided below :-
01. Class Notes
02. NCERT Informatics Practices Class XI
03. NCERT Informatics Practices Class XII
04. YouTube Channel
“Computer Concepts AK Pandey”

Teacher’s Signature

You might also like