Rajshahi University of Engineering & Technology: Lab Report
Rajshahi University of Engineering & Technology: Lab Report
Lab Report
Submitted To:
Dr. Md. Ali Hossain
Associate Professor
Department of Computer Science and Engineering
Submitted By:
Audity Ghosh
Roll: 1703001 Section: A
Department of Computer Science and Engineering
Database schema:
instructor(ID:varchar(7),name:varchar(20) , dept_name: varchar(20), salary: decimal(8,2))
Table: 3.1
Table: 3.2
Query: 3 (Distinct ID, total and average salary of instructors from each department)
SELECT department,COUNT(DISTINCT ID) as Faculty_Members, SUM(salary) as
total_salary,AVG(salary) as avg_salary FROM instructor GROUP BY department
Table: 3.3
Query:4(Average salary of instructors from each department having average salary greater than
42000)
Table: 3.4
Query: 5 (Print the name and salary of instructors whose salary is greater than at least one
instructor from “Biology” department.)
SELECT DISTINCT T.name, T.salary
from instructor as T, instructor as S
WHERE T.salary>S.salary AND department = ‘Biology’
Table: 3.5
Output:
Aggregate functions were implemented and ‘GROUP BY” query was implemented with
‘HAVING’ clause and ‘self-join’ was implemented.
Conclusion:
The tasks were completed and the queries contained no errors.