0% found this document useful (0 votes)
41 views

Employee - Id First - Name Last - Name Salary Joining - Date Department

This document contains sample SQL queries written to retrieve data from two tables, Employee and Incentives, including queries to select the top 2 highest salaries from the Employee table, select the 2nd highest salary from the Employee table, and find the position of the letter 'o' in the name 'John' from the Employee table.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Employee - Id First - Name Last - Name Salary Joining - Date Department

This document contains sample SQL queries written to retrieve data from two tables, Employee and Incentives, including queries to select the top 2 highest salaries from the Employee table, select the 2nd highest salary from the Employee table, and find the position of the letter 'o' in the name 'John' from the Employee table.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name:

Employee code:
Date:
SQL Queries (Written):
Table Name : Employee
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
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

1. Select TOP 2 salary from employee table



2. Select 2nd Highest salary from employee table



3. Get position of 'o' in name 'John' from employee table

You might also like