You are on page 1of 7

1.

STRUCTURED
QUERY LANGUAGE
(SQL)
1) Create database sanyam;

2) Create table student


(
rno int primary key,name varchar(20),age int
);
3) desc student;

4) Alter table student add marks int;

5) Alter table student add pincode int;

6) Alter table student drop pincode;


7) Alter table student drop marks;

8) Insert into student values


(1,"Sanyam",16);

9) Insert into student values


(2,"Vansh",17);

10) Insert into student values


(3,"Aditya",18);
11) Insert into student values
(4,"Anuj",16);

12) Insert into student values


(5,"Arbaz",17);

13) Update student


set name="Sanyam Gupta"
where name="Sanyam";
14) Select * from student;

15) Select age from student;

16) Select * from student


where age>16;
17) Select * from student
order by age desc;

18) Select name from student


where rno between 1 and 3;

19) Select * from student


where age in(16);
20) Select age from student
where name like 'A%';

**********************************************

You might also like