You are on page 1of 1

Kingdom of Saudi Arabia ‫المملكة العربية الســــعـودية‬

Ministry of Higher Education ‫وزارة التعليم العـــــــالي‬


Majmaah University,
College of Computer &
‫جامــــــــــــــــعة المجمعة‬
‫كلية علوم الحاسب والمعلومات‬

College of Computer & Information Sciences

IS 231: Fundamentals of Database


Exercises on SQL

Consider the following table:


Emp_i Emp_name Job_name Manager_i Hire_date Salary Commissio Dep_id
d d n

68319 KAYLING PRESIDENT 1991-11-18 6000.00 1001

66928 BLAZE MANAGER 68319 1991-05-01 2750.00 3001

67832 CLARE ANALYST 65646 1997-04-19 3100.00 2001

64989 ADELYN ANALYST 66928 1991-02-20 1700.00 400.00 3001

66564 MADDEN SALESMAN 66928 1991-09-28 1350.00 1500.00 3001

Answer the following Queries

a. Write a query in SQL to find the salaries of all employees


b. Write a query in SQL to list the employees who does not belong to department 2001.
c. Write a query in SQL to list the emp_id, salary, and commission of all the employees. 
d. Write a query in SQL to list the employees who joined before 1991
e. Write a query in SQL to display the average salaries of all the employees who works as
ANALYST.
f. Write a query in SQL to display the details of the employee BLAZE
g. Write a query in SQL to display all the details of the employees whose commission is more
than their salary. 
h. Write a query in SQL to list all the employees whose designation is CLERK
i. Write a query in SQL to list the employees whose salaries are less than 3500

1|1

You might also like