Queries Stored

You might also like

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

1.

SELECT * FROM student WHERE age>50 //having age


> 50
2. SELECT * FROM student WHERE cid=101 AND marks>1000 //reading
101 + having passing marks
3. SELECT * FROM student WHERE cid<>101 AND marks<1000 //not
reading 101 and failed
4. INSERT INTO student VALUES(21,'Raza',1045,52,102) //add a new
record
5. DELETE * FROM student WHERE rollno>=37 //delete last 3
records
6. UPDATE student SET cid=100 WHERE rollno=37 //update cid
7. ALTER TABLE student ADD city text //add city
column
8. SELECT * FROM student WHERE city='Multan' //show all
students belonging to Multan
9. SELECT * FROM student WHERE city<>'Multan' AND city='Chichawatni' //show
all students not belonging to Multan and belonging to ______
10. SELECT * FROM student WHERE age>=20 AND city='Multan' AND cid=101 //show
all students having age>=20,belonging to Multan and reading 101
11. SELECT * FROM student WHERE age=20 AND marks=1094 //having
similar age and marks

You might also like