Top 100+ Complex Sql Queries Interview Questions And Answers
Question 1. Query To Find Second Highest Marks Of A Student?
Answer :
Based On the Below Student table We are Written All the Queries.
Student Table
SELECT marks FROM Student ORDER by means of marks DESC restrict 1, 1;
Question 2. Query To Find Duplicate Rows In Table?
Answer :
SELECT std_id, COUNT(std_id) as cnt FROM Student GROUP by using std_id having cnt > 1
PL/SQL Interview Questions
Question 3. What Is The Query To Fetch First Record From Student Table?
Answer :
SELECT * from Student wherein identification = 1;
Question 4. What Is The Query To Fetch Last Record From The Student Table?
Answer :
SELECT * FROM Student order via identity desc restriction 1
C++ Tutorial
Question five. What Is Query To Display First 4 Records From Student Table?
Answer :
SELECT * FROM Student restriction four
C++ Interview Questions
Question 6. What Is Query To Display Last 3 Records From Student Table?
Answer :
SELECT * FROM Student order by std_id Desc restriction 3
Question 7. What Is Query To Display Nth Record From Student Table?
Answer :
Select * from Student wherein id = $n;
MySQL Tutorial MySQL Interview Questions
Question 8. How To Get 3 Highest Marks From Student Table?
Answer :
SELECT awesome(marks) FROM Student ORDER BY marks DESC LIMIT zero,three
Question 9. How To Display Odd Rows In Student Table?
Answer :
SELECT * FROM Student wherein MOD(identity,2) = 1
DB2 Using SQL Interview Questions
Question 10. How To Display Even Rows In Student Table?
Answer :
SELECT * FROM Student where MOD(identity,2) = 0
DB2 Using SQL Tutorial
Question eleven. How Can I Create Table With Same Structure Of Student Table?
Answer :
Create desk std as Select * from Student;
SQL DBA Interview Questions
Question 12. Select All Records From Student Table Whose Name Is ‘abhi’ And ‘geethasri’.
Answer :
Select * from Student in which Name in(‘Abhi’ , ’Geethasri’);
PL/SQL Interview Questions