0% found this document useful (0 votes)
2 views1 page

SQL Queries for Student Database Management

The document contains a series of SQL queries designed to retrieve specific data from a 'Students' database. It includes commands to select names and emails, distinct cities, order marks, filter by ID, name, marks, age, and apply limits and patterns in name searches. The queries demonstrate various SQL functionalities such as ordering, filtering, and pattern matching.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

SQL Queries for Student Database Management

The document contains a series of SQL queries designed to retrieve specific data from a 'Students' database. It includes commands to select names and emails, distinct cities, order marks, filter by ID, name, marks, age, and apply limits and patterns in name searches. The queries demonstrate various SQL functionalities such as ordering, filtering, and pattern matching.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

1) Select name, email from Students

2) Select distinct city from Students


3) Select marks from Students ORDER BY marks DESCENDING
4) Select * from Student where id = 1426
5) Select * from Student where name = 'sumit' AND marks = 90
6) Select * from Student where marks > 50
7) Select * from Student where age BETWEEN 30 AND 50
8) Select * from Student ORDER BY marks DESC LIMIT 1, 1[index --> 0, 1] [number of
record kitna chahiye --> 1]
9) Select * from Student LIMIT 0, 10 [first 10 record tk jana hai]
10) Select * from Student where name LIKE "ankit%" [display the records whose name
starts with ankit]
11) Select * from Student where name LIKE '__v%' [display the name whose 3rd letter
is V] --> first 2 letter ni pta to (__) and the V and then 'V' ke baad jo v hoga wo
print ho jayega

You might also like