DB-Lab Major
DB-Lab Major
Task:
The university needs a Course Management System to store information about students,
courses, enrolments, and instructors. As a database developer, your task is to design, create,
and manipulate a MySQL database to support this system.
Table
• Instructors (InstructorID, FullName, Email, HireDate, Salary)
Table
Table
2 Insertion in Courses table
Table
Table
• Update a student’s phone number using UPDATE.
Table
• Retrieve students with last names starting with 'A' (using LIKE).
• Convert student names to uppercase (using UPPER()).
• Get the total number of students enrolled in each course (using COUNT()).
• Show enrollment dates in ‘DD-Month-YYYY’ format (using DATE_FORMAT()).
• LEFT JOIN: List all students, even those not enrolled in any
course.
• RIGHT JOIN: List all courses and the students who enrolled in them.
• Subquery: Find students who have enrolled in more than one course.
Views
7: Transaction Management
• Start a transaction.
• Create a SAVEPOINT.
• Update the student’s email.
• Grant the user SELECT and INSERT privileges on the Students table.
Write a stored procedure that takes a CourseID as input and returns the number of students
enrolled.
• Create a Function