- Question 1. Query To Find Second Highest Marks Of A Student?Answer :Based On the Below Student table We are Written All the Queries.SELECT marks FROM Student ORDER by marks DESC limit 1, 1;
- Question 2. Query To Find Duplicate Rows In Table?Answer :SELECT std_id, COUNT(std_id) as cnt FROM Student GROUP by std_id having cnt > 1
- Question 3. What Is The Query To Fetch First Record From Student Table?Answer :SELECT * from Student where id = 1;
- Question 4. What Is The Query To Fetch Last Record From The Student Table?Answer :SELECT * FROM Student order by id desc limit 1
- Question 5. What Is Query To Display First 4 Records From Student Table?Answer :SELECT * FROM Student limit 4
- Question 6. What Is Query To Display Last 3 Records From Student Table?Answer :SELECT * FROM Student order by std_id Desc limit 3
- Question 7. What Is Query To Display Nth Record From Student Table?Answer :Select * from Student where id = $n;
- Question 8. How To Get 3 Highest Marks From Student Table?Answer :SELECT distinct(marks) FROM Student ORDER BY marks DESC LIMIT 0,3
- Question 9. How To Display Odd Rows In Student Table?Answer :SELECT * FROM Student where MOD(id,2) = 1
- Question 10. How To Display Even Rows In Student Table?Answer :SELECT * FROM Student where MOD(id,2) = 0
- Question 11. How Can I Create Table With Same Structure Of Student Table?Answer :Create table std as Select * from Student;
- Question 12. Select All Records From Student Table Whose Name Is ‘abhi’ And ‘geethasri’.Answer :Select * from Student where Name in(‘Abhi’ , ’Geethasri’);
Home / Complex SQL Queries Complex SQL Queries Examples
/ Complex SQL Queries Complex SQL Queries Examples
Subscribe to:
Post Comments
(
Atom
)
Featured post
Political Full Forms List
Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...
0 comments:
Post a Comment