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

Exercises SQL

The document outlines SQL exercises for a course on database fundamentals at Majmaah University. It includes a sample employee table and provides a series of queries for students to write, focusing on employee salaries, department affiliations, and job titles. The exercises aim to enhance students' practical skills in SQL querying.

Uploaded by

-
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Exercises SQL

The document outlines SQL exercises for a course on database fundamentals at Majmaah University. It includes a sample employee table and provides a series of queries for students to write, focusing on employee salaries, department affiliations, and job titles. The exercises aim to enhance students' practical skills in SQL querying.

Uploaded by

-
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Kingdom of Saudi Arabia ‫اﻟﻣﻣﻠﻛﺔ اﻟﻌرﺑﯾﺔ اﻟﺳــــﻌـودﯾﺔ‬

Ministry of Higher Education


‫وزارة اﻟﺗﻌﻠﯾم اﻟﻌـــــــﺎﻟﻲ‬
Majmaah University,
College of Computer & ‫ﺟﺎﻣــــــــــــــــﻌﺔ اﻟﻣﺟﻣﻌﺔ‬
Information Sciences ‫ﻛﻠﯾﺔ ﻋﻠوم اﻟﺣﺎﺳب واﻟﻣﻌﻠوﻣﺎت‬

College of Computer & Information Sciences

IS 213: Fundamentals of Database


Exercises on SQL

Consider the following table:


Emp_id Emp_name Job_name Manager_id Hire_date Salary Commission Dep_id

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

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


2. Write a query in SQL to list the employees who does not belong to department 2001.
3. Write a query in SQL to list the emp_id, salary, and commission of all the employees.
4. Write a query in SQL to list the employees who joined before 1991
5. Write a query in SQL to display the average salaries of all the employees who works as
ANALYST.
6. Write a query in SQL to display the details of the employee BLAZE
7. Write a query in SQL to display all the details of the employees whose commission is
more than their salary.
8. Write a query in SQL to list all the employees whose designation is CLERK
9. Write a query in SQL to list the employees whose salaries are less than 3500

1|1

You might also like