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

CSE370_Lab Assignment02_Spring2025

The document contains a series of SQL queries related to employee data in a database for an assignment in a Database Systems course. Each query is designed to extract specific information from the Employee table based on various conditions, such as hire dates, salaries, and commission percentages. Additionally, there are placeholders for screenshots of query outputs in the shell.

Uploaded by

towsif.khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

CSE370_Lab Assignment02_Spring2025

The document contains a series of SQL queries related to employee data in a database for an assignment in a Database Systems course. Each query is designed to extract specific information from the Employee table based on various conditions, such as hire dates, salaries, and commission percentages. Additionally, there are placeholders for screenshots of query outputs in the shell.

Uploaded by

towsif.khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CSE370 : Database Systems

Assignment 01/02/03 | Spring 2025


ID : 22101186 | Name : Towsif Khan

No 1 Query Select first_name, last_name, email, phone_number, hire_date, department_id from Employee where hire_date = (select
(as Plain Text) max(hire_date) from Employee);

No 1 SS
(of Query & Output
in Shell)

No 2 Query Select first_name, last_name, employee_id, phone_number, salary, department_id from Employee
(as Plain Text) where (department_id, salary) in (select department_id, min(salary) from Employee group by department_id);

No 2 SS
(of Query & Output
in Shell)
No 3 Query Select first_name, last_name, employee_id, commission_pct, department_id from Employee where department_id =
(as Plain Text) 'DPT007' and commission_pct < all (Select commission_pct from Employee where department_id = 'DPT005');

No 3 SS
(of Query & Output
in Shell)

No 4 Query Select department_id, count(*) as total_employees from Employee group by department_id having max(salary) <= 30000;
(as Plain Text)

No 4 SS
(of Query & Output
in Shell)

No 5 Query Select department_id, job_id, commission_pct from Employee e1 where commission_pct < (Select max(commission_pct)
(as Plain Text) from Employee e2 where e1.department_id = e2.department_id);
No 5 SS
(of Query & Output
in Shell)

No 6 Query Select Distinct manager_id from Employee where manager_id not in (Select manager_id from Employee where salary <
(as Plain Text) 3500);

No 6 SS
(of Query & Output
in Shell)

No 7 Query
(as Plain Text) Select first_name, last_name, employee_id, email, salary, department_id, commission_pct from Employee e1 where
commission_pct = (Select min(commission_pct) from Employee e2 where e1.manager_id = e2.manager_id);
No 7 SS
(of Query & Output
in Shell)

You might also like