Professional Documents
Culture Documents
Report
Report
ERD:
2.Retrieve a list of all students and the courses they are currently enrolled in, including course details.
This code returns information of students and the courses that they have taken including coursecode
and the id of the instructors.
4.Identify the student(s) with the highest GPA and their academic records.
This query calculates GPA of every student according their transcripts by using CASE clause and after
ordering them in descending order it retrieves the student with highest GPA by using LIMIT clause;
6.Determine which departments offer the most courses by counting the number of courses offered in
each department.
This query counts the number of courses in each department which is determined by departmentid in
courses table and retrieves sorted list of departments along with the number of courses they have.
8.Find the student groups with the most members and list the group names and member counts.
This code count the number of students in each group and return top 5 student groups according to the
number of members;
This query counts the rooms that are occupied by using FILTER clause and divides this number to the
number of all rooms;
10.Compute the average cost of meal plans for different student groups (e.g., freshmen, sophomores,
etc.).
This code by using information about meal plans, calculates the average cost for every course.
This code calculates total revenue generated by each department by counting the number of credits that
has been taken during enrollments and multiplying that number by 24000 the cost of one credit;
12. Find the number of available library resources and the number checked out by students.
The checked out books in the library has student id of a student who checked out the book. If the book
is not checked out this student id will be NULL. This code counts the number of records where student
id is not NULL by using FILTER clause, and count the number of all records;
13. Calculate the number of student visits to health services and their average visit duration.
This code counts the number of unique students ids in healthservices table by using DISTINCT clause
and calculates the average visit duration in minutes;
14. List student achievements (awards, honors) and group them by the student's department.
This code determines in which department is a student who got an achievement and retrieves the
department name along with the achievement name.
This code left joins the students and internships tables. The students who has no internships will have
NULL as internship id. After that it divides the number of students who has internships by the number
of all students;
16. Find the countries where students have studied abroad and the number of students in each country
This code counts the number of rows from studyabroad table and for each country outputs the number
of count;
17. List the upcoming campus events and their details, sorted by date.
This query outputs all the upcoming events ordered by date that will take place after 1 December 2023;
19. Identify faculty members who have expertise in specific research areas, based on their academic
records.
This query just retrieves the names of instructors that have experise;
21. Verify if students enrolling in advanced courses meet the prerequisites by checking their transcript
records.
This code in order to check whether the student who has taken a course with prerequisites meet them
makes two subqueries. In the first subquery(the left part of the join) it takes information about
enrollments with courses that have prerequisites. In the second subquery(the right part of the join) it
takes information about all enrollments of all students. The LEFT JOIN works as follow: for each
course that have prerequisite from the first subquery it tries to find the course that is the prerequisite
itself. If it fails to find such an enrollment then the course will be NULL.
After that the query by using CASE clause determines if the prerequisite has been taken: if the
‘takencourse’ column is NULL then there is no prerequisite taken and it outputs FALSE, or it ouputs
TRUE otherwise;
22.List students with outstanding fees, including the total amount owed.
This query operates with ‘studentfees’ table and sums up balance for each student, after that it retrieves
the studentid and balance of students who has negative balance in ordered view. We can see that on
students owes 120000 tenge to the university. Maybe he has taken retake in DBMS because he didn’t
finish project in time.
23.Identify instructors who are teaching multiple courses in the same term and list the courses they are
teaching.
This query retrieves the instructors that teach multiple different courses by counting the number of
unique courseid for each instructor by using DISTINCT clause.
24.Calculate statistics on student diversity, such as the distribution of gender, ethnicity, or nationality.
This query count the number of student with different genders, namely males and felamales.
25.Find the most popular combinations of courses (sets of courses taken together) among students.
--
26.Compare the academic performance (GPA) of students based on their faculty advisors.
This query according students transcripts calculates the GPA and by using JOIN clause find their
advisor outputs the name and surname of advisor.
27.Identify student groups that have members from a wide range of majors, promoting interdisciplinary
collaboration.
This code count the number of unique major of each student groups member by using DISTINCT
clause and outputs the top five student groups with the largest number of different majors members.
28.List courses with consistently high enrollment, helping with scheduling and resource allocation.
This query retrieves top 5 most taken courses according the number of enrollments.
29.Calculate the average time it takes students to graduate, considering their major and any changes in
degree programs.
This query calculates the average number of years needed to graduate for each major by calculating the
average difference between the graduation date and admission date of graduated students;
30.Determine if students who complete internships have a higher graduation rate compared to those
who do not.
---