Sei sulla pagina 1di 4

2/3/2014 SQL Queries Interview Questions and Answers - Query Examples - Page 2

Skip to content
Jump to main navigation and login
Jump to additional information

Nav view search


Navigation

Home
Careers Jobs
Interview Questions
Placement Test
Seminar Topics
B.E Projects
Tutorials
Blog
Forum

Search

Top 80 + SQL Query Interview Questions and Answers with Examples


- Page 2
Top 80 + SQL Query Interview Questions and Answers with Examples 200 Votes
( 200 Votes )

User Rating: 4 / 5

Please rate Vote 5 Rate

Details
Created: Tuesday, 26 February 2013 02:54
Last Updated: Friday, 20 December 2013 08:42
Hits: 95719

1
2
3
4
5
6
7
All Pages

http://a4academics.com/interview-questions/53-database-and-sql/397-top-100-database-sql-interview-questions-and-answers-examples-queries?showall=… 1/4
2/3/2014 SQL Queries Interview Questions and Answers - Query Examples - Page 2

Page 2 of 7

Database SQL Queries Interview Questions and answers on "SQL Order By"

15. Get all employee details from the employee table order by
First_Name Ascending

Select * from employee order by FIRST_NAME asc

16. Get all employee details from the employee table order by
First_Name descending

Select * from employee order by FIRST_NAME desc

17. Get all employee details from the employee table order by
First_Name Ascending and Salary descending

Select * from employee order by FIRST_NAME asc,SALARY desc

SQL Queries Interview Questions and Answers on "SQL Where


Condition" - Examples
18. Get employee details from employee table whose employee name is “John”

Select * from EMPLOYEE where FIRST_NAME = 'John'

19. Get employee details from employee table whose employee name are “John” and “Roy”

Select * from EMPLOYEE where FIRST_NAME in ('John','Roy')

20. Get employee details from employee table whose employee name are not “John” and “Roy”

Select * from EMPLOYEE where FIRST_NAME not in ('John','Roy')

SQL Queries Interview Questions and Answers on "SQL Wild Card


Search" - Examples
21. Get employee details from employee table whose first name starts with 'J'

Select * from EMPLOYEE where FIRST_NAME like 'J%'

22. Get employee details from employee table whose first name contains 'o'

Select * from EMPLOYEE where FIRST_NAME like '%o%'

23. Get employee details from employee table whose first name ends with 'n'

Select * from EMPLOYEE where FIRST_NAME like '%n'

http://a4academics.com/interview-questions/53-database-and-sql/397-top-100-database-sql-interview-questions-and-answers-examples-queries?showall=… 2/4
2/3/2014 SQL Queries Interview Questions and Answers - Query Examples - Page 2

SQL Queries Interview Questions and Answers on "SQL Pattern


Matching" - Examples
24. Get employee details from employee table whose first name ends with 'n' and name contains 4 letters

Select * from EMPLOYEE where FIRST_NAME like '___n' (Underscores)

25. Get employee details from employee table whose first name starts with 'J' and name contains 4 letters

Select * from EMPLOYEE where FIRST_NAME like 'J___' (Underscores)

26. Get employee details from employee table whose Salary greater than 600000

Select * from EMPLOYEE where Salary > 600000

27. Get employee details from employee table whose Salary less than 800000

Select * from EMPLOYEE where Salary < 800000

28. Get employee details from employee table whose Salary between 500000 and 800000

Select * from EMPLOYEE where Salary between 500000 and 800000

29. Get employee details from employee table whose name is 'John' and 'Michael'

Select * from EMPLOYEE where FIRST_NAME in ('John','Michael')

<< Prev
Next >>

Find & Remove Duplicates


www.cloudingo.com
Get rid of duplicates in your CRM From the makers of DupeCatcher!
Close info

Additional information

Share

http://a4academics.com/interview-questions/53-database-and-sql/397-top-100-database-sql-interview-questions-and-answers-examples-queries?showall=… 3/4
2/3/2014 SQL Queries Interview Questions and Answers - Query Examples - Page 2

► SQL Database
► Access Database Tutorial
► SQL Server Tool

Featured Posts

Careers Choices for Electronics and Communication Engineers | Job Opportunities

Careers Guidance for Computer Science Engineers | Job Opportunities

SQL Interview Questions and Answers for Freshers, Experienced | Database

Top 80 + SQL Query Interview Questions and Answers with Examples

Realted Articles

RDBMS Definition, DBMS Definition and SQL Advantages


SQL Interview Questions and Answers for Freshers, Experienced | Database
Java OOPS Interview Questions and Answers
C++ Interview Questions and Answers For Freshers | Experienced
.Net Framework Interview Questions and Answers
ADO.Net Interview Questions and Answers for Freshers, Experienced
Oracle Interview Questions and Answers on SQL Queries and Database Theory
Core Java Interview Questions and Answers
Java Inheritance Example Code - Extends

You are here: Home Interview Questions Database and SQL Interview Questions and Answers Top 80 + SQL
Query Interview Questions and Answers with Examples

http://a4academics.com/interview-questions/53-database-and-sql/397-top-100-database-sql-interview-questions-and-answers-examples-queries?showall=… 4/4

Potrebbero piacerti anche