A4academics Com Interview Questions 53 Database and SQL 397
A4academics Com Interview Questions 53 Database and SQL 397
Career Tips
Interview Questions
Jobs
Placement Test
Seminar Topics
B.E Projects
Soft Skills
Tutorials
AdChoices
SQL Queries
Database SQL
SQL Tutorial
Hits: 429547
Frequently asked basic and advanced Top 80 + SQL Queries Interview Questions and Answers with
Examples for Business Analyst, Data Analyst, DBA, Freshers and Experienced Java, PHP, Dot Net
programmers in Oracle, MySQL and MS SQL Database.
pdfcrowd.com
Are you an Experienced Programmer or Database Administrator ? If so, visit our Interview
Questions on Advanced and Complex SQL Query section of this article. For each question, if the SQL
Commands differ for Oracle, MySQL and SQL Server Databases, specific queries with respect to a
database is provided. If the answers are same for all databases, only one query is specified. Interview
Questions on SQL are based on following two tables, Employee Table and Employee Incentive Table.
pdfcrowd.com
Joining_date
Department
John
Abraham
Michael
Clarke
800000
Roy
Thomas
700000
Tom
Jose
600000
Jerry
Pinto
650000
Philip
Mathew
750000
TestName1
123
650000
TestName2
Lname%
600000
01-FEB-13
5000
01-FEB-13
3000
pdfcrowd.com
01-FEB-13
4000
01-JAN-13
4500
01-JAN-13
3500
3. Get First_Name from employee table using alias name Employee Name
Select first_name Employee Name from employee
pdfcrowd.com
pdfcrowd.com
pdfcrowd.com
9. Get FIRST_NAME from employee table after removing white spaces from right side
select RTRIM(FIRST_NAME) from employee
10. Get FIRST_NAME from employee table after removing white spaces from left side
select LTRIM(FIRST_NAME) from employee
pdfcrowd.com
SQL Server Equivalent of Oracle,MYSQL Length is Len, Query :select len(FIRST_NAME) from
employee
12. Get First_Name from employee table after replacing 'o' with '$'
select REPLACE(FIRST_NAME,'o','$') from employee
13. Get First_Name and Last_Name as single column from employee table separated by a '_'
Oracle Equivalent of MySQL concat is '||', Query : Select FIRST_NAME|| '_' ||LAST_NAME from
EMPLOYEE
SQL Server Equivalent of MySQL concat is '+', Query : Select FIRST_NAME + '_' +LAST_NAME
from EMPLOYEE
pdfcrowd.com
14. Get FIRST_NAME ,Joining year,Joining Month and Joining Date from employee table
SQL Queries in Oracle, Select FIRST_NAME, to_char(joining_date,'YYYY') JoinYear ,
to_char(joining_date,'Mon'), to_char(joining_date,'dd') from EMPLOYEE
Page 1 of 7
open in browser PRO version
pdfcrowd.com
Pages
You are here: Home > Interview Questions > Database & SQL Interview Questions and Answers > Top 80 + SQL Query Interview
Questions and Answers with Examples
pdfcrowd.com
Popular Posts
HR Interview Questions and Answers
SQL Interview Questions and Answers
Java Interview Questions and Answers
SQL Query Interview Questions and Answers
Careers Choices and Job Opportunities for Electronics and Communication Engineers
Related Articles
Database/SQL Interview Questions and Answers for Freshers, Experienced
Oracle Interview Questions and Answers on SQL Queries and Database Theory
open in browser PRO version
pdfcrowd.com
Popular Categories
Database Interview Questions and Answers
.Net Interview Questions and Answers
open in browser PRO version
pdfcrowd.com
Email Newsletter
Enter your Email Address and get interesting updates
Your email Address...
Subscribe
open in browser PRO version
pdfcrowd.com
Quick Links
Home
B.E Projects
Careers Jobs
Tutorials
Interview Questions
Blog
Placement Test
Forum
Seminar Topics
Quick Contacts
Follow us on
E: [email protected]
W: www.a4academics.com
pdfcrowd.com