Assignment 01: F C Riphah International University
Assignment 01: F C Riphah International University
Assignment 01
Submitted by SAP_ID.
DATABASE SYSTEMS
Q.No.1 Write a query that displays the last name and salary of employees who earn more than
$12,000 salary.
Ans:
Page 1 of 4
from employees
Q.No.2 Create a query to display the last name and salary for any employee whose salary is not in
the range of $5,000 to $12,000.
Ans
from employees
Q.No3 Create a query to display the last name and department number of all employees in
departments 20 or 50 in ascending alphabetical order by name.
Ans:
from employees
order by last_name;
Q.NO4 Write a query to display the First name, last name, job ID, and start date for the employees
with the last names of Matos and Taylor. Order the query in ascending order by start date.
Ans
from employees
order by hire_date;
Q.NO5 Write a query to display the last name and job title of all employees who do not have a
manager.
Ans
Page 2 of 4
from employees
Q.No6 Write a query to display all employee last names in which the third letter of the name is a
Ans
select last_name
from employees
Q.No7 Write a query to display the last names of all employees who have both an a and an e in their
last name.
Ans
select last_name
from employees
Q.No8 Write a Query to display the employee number, last name, salary, and salary increased by
15.5% (expressed as a whole number) for each employee. Label the column New Salary
Ans
from employees;
Q.No9 Write a query to display the last name and salary for all employees. Format the salary to be
15 characters long, left-padded with the $ symbol. Label the column SALARY.
Ans
from employees;
Page 3 of 4
Q.No10 Create a report to display the current date. Label the column Date.
Ans
Q.No11 Write a query to display the average and maximum salary of those employees who have odd
employee number
Ans
Select employee_id,salary
Page 4 of 4