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

VARUN

practical
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)
29 views6 pages

VARUN

practical
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

IP PRACTICAL FILE

CONSIDER THE FOLLOWING TABLE STUDENT


AND ANSWER THE FOLLOWING:

a. Create above table student


(Rollno int primary key,
Name varchar(20),
Gender char(20),
Marks int,
DOB date
Mobile_no int,
Stream char (20));

b.Insert data in table student


into student values('1.','Raj
Kumar','M',93,'17-10 -
2000',9586774748,'Science');
insert into student values('2.','Deep
Singh','M',98,'22-08 -
1996',8988886577,'Commerce');
insert into student values('3.','Ankit
Sharma','M',76,'02-02 -2000',NULL,'Science');

insert into student values('4.','Radhika


Gupta','F',78,'03-12 -
1999',9818675444,'Humanities');

insert into student values('5.','Payal


Goel','F',82,'21-04 -
1998',9845639990,'Vocational');

insert into student values('6.','Diksha


Sharma','F',80,'17-12 -
1999',9897666650,'Humanities');

insert into student values('7.','Gurpreet


Kaur','F',NULL,'04-01 -
2000',7560875609,'Science');

insert into student values('8.','Akshay


Dureja','M',90,'15-05 -
1997',9560567890,'Commerce');
insert into student values('9.','Shreya
Anand','F',70,'08-09 -1999',NULL,'Vocational');

insert into student values('10.','Prateek


Mittal','M',75,'25-12-2000',9999967543,'Science');

c.display all students from table


ANS. select *from student;

d.display streams from table removing duplicate


entries
ANS.Select distinct Stream from student;

E. display name, gender and DOB of students


where Dob is between 02-02-2000 to 25-12-
2000

ANS.Select Name,Gender,DOB from student


where DOB between ‘02-02-2000’ and ‘25-12-
2000’;

F. display names of students that ends with ‘a’

ANS.Select Name from student where Name


like’%a’;
G.display students whose name has ‘u’ in them
ANS. Select * from student where Name like’%u
%’;

H. display students in alphabetical order of


names
ANS. Select * from student order by Name;

I.display name and mobile number of students


where there is no mobile_no

ANS. Select Name,Mobile_no from student


where Mobile_No =’NULL’;

J. display the stream of male students


ANS. Select stream from student
where Gender=’M’;
SQL PRACTICAL
BY VARUN SINGH
11-E

You might also like