Premium Essay

Sbsehe

In:

Submitted By naresh123
Words 4444
Pages 18
Table Name : Employee
EMPLOYEE
_ID

FIRST_NA
ME

LAST_NA
ME

SALA
RY

JOINING_D
ATE

DEPARTME
NT

1

John

Abraham

1000000

01-JAN-13
12.00.00 AM

Banking

2

Michael

Clarke

800000

01-JAN-13
12.00.00 AM

Insurance

3

Roy

Thomas

700000

01-FEB-13
12.00.00 AM

Banking

4

Tom

Jose

600000

01-FEB-13
12.00.00 AM

Insurance

5

Jerry

Pinto

650000

01-FEB-13
12.00.00 AM

Insurance

6

Philip

Mathew

750000

01-JAN-13
12.00.00 AM

Services

7

TestName1

123

650000

01-JAN-13
12.00.00 AM

Services

8

TestName2

Lname%

600000

01-FEB-13
12.00.00 AM

Insurance

Table Name : Incentives
EMPLOYEE_REF_ID

INCENTIVE_DATE

INCENTIVE_AMOUNT

1

01-FEB-13

5000

2

01-FEB-13

3000

3

01-FEB-13

4000

1

01-JAN-13

4500

2

01-JAN-13

3500

SQL Queries Interview Questions and Answers on "SQL Select"
1. Get all employee details from the employee table
Select * from employee
2. Get First_Name,Last_Name from employee table
Select first_name, Last_Name from employee
3. Get First_Name from employee table using alias name “Employee Name”
Select first_name Employee Name from employee
4. Get First_Name from employee table in upper case
Select upper(FIRST_NAME) from EMPLOYEE

5. Get First_Name from employee table in lower case
Select lower(FIRST_NAME) from EMPLOYEE
6. Get unique DEPARTMENT from employee table select distinct DEPARTMENT from EMPLOYEE
Don't Miss - SQL and Database theory Interview Questions

7. Select first 3 characters of FIRST_NAME from EMPLOYEE
Oracle Equivalent of SQL Server SUBSTRING is SUBSTR, Query : select substr(FIRST_NAME,0,3) from employee
SQL Server Equivalent of Oracle SUBSTR is SUBSTRING, Query : select substring(FIRST_NAME,0,3) from employee
MySQL Server Equivalent of

Similar Documents