0% found this document useful (0 votes)
57 views7 pages

IP Prctical File Class XI

The document outlines a series of SQL commands for creating and managing a database named Class11, including the creation of a student table with various attributes. It details operations such as inserting student records, updating marks, deleting records based on criteria, and querying the database for specific information. Additionally, it includes commands for altering the table structure and displaying data based on different conditions.

Uploaded by

kowsiramya25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views7 pages

IP Prctical File Class XI

The document outlines a series of SQL commands for creating and managing a database named Class11, including the creation of a student table with various attributes. It details operations such as inserting student records, updating marks, deleting records based on criteria, and querying the database for specific information. Additionally, it includes commands for altering the table structure and displaying data based on different conditions.

Uploaded by

kowsiramya25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1.

Create Database Named Class11


create database class11;

2. Open Database Class 11


use class11;

3. Create a student table with the student id, class, section, gender, name, dob,
andmarks as attributes where the student id is the primary key.
create table student
(studentid int(4) primary key,
class char(2),
section char(1),
gender char(1),
name varchar(20),
dob date,
marks decimal(5,2));

TERM 2 CLASS XI IP PRACTICAL FILE | Downloaded from www.tutorialaicsip.com | Page 5


4. View the structure of the table
desc student; OR
describe student

5. insert the details of at least 10 students in the above table.


insert into student values
(1101,'XI','A','M','Aksh','2005/12/23',88.21),
(1102,'XI','B','F','Moksha','2005/03/24',77.90),
(1103,'XI','A','F','Archi','2006/04/21',76.20),
(1104,'XI','B','M','Bhavin','2005/09/15',68.23),
(1105,'XI','C','M','Kevin','2005/08/23',66.33),
(1106,'XI','C','F','Naadiya','2005/10/27',62.33),
(1107,'XI','D','M','Krish','2005/01/23',84.33),
(1108,'XI','D','M','Ayush','2005/04/23',55.33),
(1109,'XI','C','F','Shruti','2005/06/01',74.33),
(1110,'XI','D','F','Shivi','2005/10/19',72.30);

TERM 2 CLASS XI IP PRACTICAL FILE | Downloaded from www.tutorialaicsip.com | Page 6


6. Display the details of the student table.
select * from student;

TERM 2 CLASS XI IP PRACTICAL FILE | Downloaded from www.tutorialaicsip.com | Page 7


7. Delete record of students who secured less than 65 marks.
delete from student where marks <65;

8. Increase marks by 5% for who have studentid more than 1105.


update stduent set marks=makrs+(marks*0.05) where studentid>1105;

9. Display the content of the table of female students.


select * from student where gender = 'f';

TERM 2 CLASS XI IP PRACTICAL FILE | Downloaded from www.tutorialaicsip.com | Page 8


10. Display studentid, Name and Marks whose marks are more than 50.
select studentid,name,marks from student where marks>50;

11. Find the average of marks from the student table.


select avg(marks) from student;

12. Find the number of students, who are from section ‘A’.
alter table student add column email varchar(20);

13. Add a new column email in the above table.


alter table student add column email varchar(20);

TERM 2 CLASS XI IP PRACTICAL FILE | Downloaded from www.tutorialaicsip.com | Page 9


14. Add the email ids of each student in the created email column.
update student set email='[email protected]';

15. Display the information of all the students, name contains ‘sh’
select * from student where name like 'sh%';

16. Display the information of all the students, name starts with ‘sh’
select * from stduent where name like 'sh%';

17. Display studentid, Name, DOB of who are born in 2005


select studentid, name, dob from student where dob between '2005-01-
01' and '2005-12-31';

TERM 2 CLASS XI IP PRACTICAL FILE | Downloaded from www.tutorialaicsip.com | Page 10


18. Display studentid, Name, DOB, Marks, Email of male students in ascending
order of their names.
select studentid, name, dob from student order by name;

19. Display stduentid, Gender, Name, DOB, Marks, Email in descending order of
their marks.
select studentid, gender, name, dob, marks, email from student order
by marks desc;

20. Display the unique section available in the table.


select distinct section from student;

TERM 2 CLASS XI IP PRACTICAL FILE | Downloaded from www.tutorialaicsip.com | Page 11

You might also like