SQL Programme Lab Record
SQL Programme Lab Record
SQL PROGRAMS
Create the following tables in database
TABLE NAME : EMPLOYEES
b)
c)
d)
2) Retrieve the count of employees in each department and their average salary:
e)
f)
3) Retrieve the employee with the highest salary:
g)
4) Retrieve all tasks along with their assigned employees:
SELECT et.taskname, e.firstname, e.lastname
FROM employeetasks et
JOIN employees e
ON et.employeeid = e.employeeid;
h)
i)
j)
k)
6) Retrieve tasks with due dates between two specific dates
(e.g., '2023-01-01' and '2023-02-01'):
l)
7) Retrieve tasks due before a specific date (e.g., '2023-01-01'):
m)
8) Count the number of tasks for each employee:
o)
p)
10) Count the number of tasks for each department:
11) Retrieve tasks and the corresponding department of the assigned employee:
t)
12) Retrieve tasks with descriptions containing a specific keyword (e.g., research):
u)
13) Retrieve details of all the employees whose name ends with ‘a’ or ‘e’
select * from employees where firstname like '%e' or firstname like '%a';