0% found this document useful (0 votes)
7 views3 pages

Course Management Database Schema

The document outlines the creation of a 'course_management' database, including tables for instructors, course categories, years of studies, courses, and coverage logs. It includes SQL statements for inserting data into these tables, establishing relationships through foreign keys, and creating indexes for efficient data retrieval. The structure is designed to manage course-related information effectively within an academic setting.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Course Management Database Schema

The document outlines the creation of a 'course_management' database, including tables for instructors, course categories, years of studies, courses, and coverage logs. It includes SQL statements for inserting data into these tables, establishing relationships through foreign keys, and creating indexes for efficient data retrieval. The structure is designed to manage course-related information effectively within an academic setting.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CREATE DATABASE course_management;

USE course_management;

CREATE TABLE instructors (


instructor_id INT AUTO_INCREMENT PRIMARY KEY,
instructor_name VARCHAR(255) NOT NULL
);

INSERT INTO instructors (instructor_name)


VALUES
('Dr. Carlson'),
('Mr. Bosnia'),
('Mr. Constantine'),
('Mr. Meek'),
('Mrs. Jessey'),
('Doctor Ivo'),
('Dr. Carine'),
('Mr. Parfait');

CREATE TABLE course_category (


category_id INT AUTO_INCREMENT PRIMARY KEY,
category_name VARCHAR(255) NOT NULL,
description TEXT,
mandatory ENUM('yes', 'no') NOT NULL,
category_code VARCHAR(20) NOT NULL,
created_by INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
FOREIGN KEY (created_by) REFERENCES instructors(instructor_id)
);

INSERT INTO course_category (category_name, description, mandatory,


category_code, created_by)
VALUES
('Software Engineering', 'Courses in software engineering', 'yes', 'SE', 1),
('Human Resources Management', 'Courses in human resources management', 'no',
'HRM', 1),
('Transport and Logistics', 'Courses in transport and logistics', 'no', 'TL', 1),
('Education', 'Courses in education', 'no', 'EDU', 1);

CREATE TABLE years_of_studies (


year_id INT AUTO_INCREMENT PRIMARY KEY,
academic_year INT NOT NULL,
start_date DATE NOT NULL,
end_date DATE NOT NULL,
semester_count VARCHAR(20) NOT NULL,
program_duration VARCHAR(20) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP
);

INSERT INTO years_of_studies (academic_year, start_date, end_date,


semester_count, program_duration)
VALUES
(1, '2023-10-01', '2024-01-31', 'First Semester', '3 months'),
(1, '2024-02-01', '2024-05-31', 'Second Semester', '3 months'),
(2, '2024-10-01', '2025-01-31', 'First Semester', '3 months'),
(2, '2025-02-01', '2025-05-31', 'Second Semester', '3 months'),
(3, '2025-10-01', '2026-01-31', 'First Semester', '3 months'),
(3, '2026-02-01', '2026-05-31', 'Second Semester', '3 months');

CREATE TABLE courses (


course_id INT AUTO_INCREMENT PRIMARY KEY,
course_name VARCHAR(255) NOT NULL,
course_code VARCHAR(20) NOT NULL,
year_id INT NOT NULL,
semester VARCHAR(20) NOT NULL,
credits INT CHECK (credits > 0 AND credits <= 6),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
FOREIGN KEY (year_id) REFERENCES years_of_studies(year_id)
);

INSERT INTO courses (course_name, course_code, year_id, semester, credits)


VALUES
('Introduction to Software Engineering', 'SE101', 1, 'First Semester', 3),
('Introduction to Human Resources Management', 'HRM101', 1, 'First Semester', 3),
('Introduction to Education', 'EDU101', 1, 'First Semester', 3),
('Data Structures', 'CS102', 1, 'Second Semester', 3),
('Organizational Behavior', 'HRM103', 1, 'Second Semester', 3),
('Education Technology', 'EDU102', 1, 'Second Semester', 3),
('Database Systems', 'CS201', 2, 'First Semester', 4),
('Strategic Human Resource Management', 'HRM201', 2, 'First Semester', 4),
('Education Policy and Planning', 'EDU201', 2, 'First Semester', 4),
('Software Testing', 'SE202', 2, 'Second Semester', 4),
('Strategic Management', 'HRM202', 2, 'Second Semester', 4),
('Curriculum Design', 'EDU202', 2, 'Second Semester', 4),
('Advanced Software Engineering', 'SE301', 3, 'First Semester', 4),
('Advanced Human Resources Management', 'HRM301', 3, 'First Semester', 4),
('Educational Leadership', 'EDU301', 3, 'First Semester', 4),
('Capstone Project', 'SE302', 3, 'Second Semester', 4),
('HRM Capstone Project', 'HRM302', 3, 'Second Semester', 4),
('Educational Dissertation', 'EDU302', 3, 'Second Semester', 4);

CREATE TABLE coverage_logs (


log_id INT AUTO_INCREMENT PRIMARY KEY,
course_id INT NOT NULL,
coverage_date DATE NOT NULL,
topic_covered VARCHAR(255) NOT NULL,
instructor_id INT NOT NULL,
remarks VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
FOREIGN KEY (course_id) REFERENCES courses(course_id),
FOREIGN KEY (instructor_id) REFERENCES instructors(instructor_id)
);

INSERT INTO coverage_logs (course_id, coverage_date, topic_covered,


instructor_id, remarks)
VALUES
(1, '2023-10-15', 'Introduction to Software Engineering', 2, 'Good job'),
(2, '2023-10-20', 'Introduction to Data Structures', 3, 'Excellent'),
(3, '2023-11-01', 'Introduction to Database Systems', 4, 'Fair'),
(4, '2023-11-15', 'Introduction to Software Testing', 5, 'Good'),
(5, '2023-10-25', 'Advanced Concepts in Software Engineering', 6, 'Excellent'),
(6, '2023-11-20', 'Capstone Project Presentation', 8, 'Fair'),
(7, '2023-10-15', 'Introduction to Human Resources Management', 7, 'Good job'),
(8, '2023-10-20', 'Introduction to Organizational Behavior', 2, 'Excellent'),
(9, '2023-11-01', 'Strategic Human Resource Management Overview', 3, 'Fair'),
(10, '2023-11-15', 'Basics of Strategic Management', 4, 'Good'),
(11, '2023-10-25', 'Education Policy and Planning', 5, 'Excellent'),
(12, '2023-11-20', 'Dissertation Presentation', 6, 'Fair');

CREATE INDEX idx_course_category_created_by ON course_category


(created_by);
CREATE INDEX idx_courses_year_id ON courses (year_id);
CREATE INDEX idx_coverage_logs_course_id ON coverage_logs (course_id);
CREATE INDEX idx_coverage_logs_instructor_id ON coverage_logs
(instructor_id);

Common questions

Powered by AI

Foreign key relationships in the course management system ensure referential integrity between tables, preventing orphaned records and maintaining consistent data across the database. For example, the 'created_by' field in the course_category table links to the instructors table, ensuring that each course category is tied to a valid instructor. Similarly, the 'course_id' field in the coverage_logs table references the courses table, guaranteeing that each log entry corresponds to an existing course. These relationships prevent the deletion of records that are still in use and enforce consistency .

The coverage logs contain remarks that provide qualitative insights into instructional performance and course coverage. For instance, remarks such as 'Excellent' and 'Good job' suggest high-performance teaching and effective course coverage, while 'Fair' might indicate areas for improvement. Analyzing these remarks over time can help identify trends, such as which instructors consistently receive positive feedback or which courses may require additional support or resources for effective instruction .

The system enforces that each course must have between 1 and 6 credits through a CHECK constraint on the 'credits' field of the courses table. This constraint ensures standardization in course load and prevents the creation of courses with an undesirably high or low credit count, which could lead to imbalanced academic workloads. Such constraints help in designing a balanced curriculum, ensuring students receive a consistent educational experience across different courses and semesters .

The 'mandatory' field in the course_category table, which can be 'yes' or 'no', differentiates between courses that are compulsory and those that are optional. This differentiation impacts student decision-making by guiding them towards mandatory courses they must complete for their program while providing flexibility and choice for non-mandatory courses, allowing students to tailor their education to their interests and career goals .

The system uses the 'DEFAULT CURRENT_TIMESTAMP' for the 'created_at' field and 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP' for the 'updated_at' field in all tables, ensuring that timestamps are automatically handled. This means each time a record is created or updated, the respective timestamp fields are automatically updated. This design allows for effective tracking of record changes over time without manual intervention .

The 'years_of_studies' table uses fields such as 'academic_year', 'start_date', 'end_date', 'semester_count', and 'program_duration' to effectively structure academic schedules. This setup allows the system to capture detailed information about each academic year's timeline, facilitating schedule management, and ensuring clarity in program duration. It directly supports academic planning by clearly defining when academic activities start and end, aiding in the coordination of courses, instructors, and resources .

The relationship between instructors and course categories is established through a foreign key constraint on the course_category table. Each course category has a 'created_by' field that references the 'instructor_id' field in the instructors table. This enforces a relationship where each course category must be associated with a specific instructor who created it, ensuring data integrity and accountability within the course management system .

The course management system uses indexes on the 'course_id' field of the coverage_logs table (idx_coverage_logs_course_id) and on the 'instructor_id' field (idx_coverage_logs_instructor_id). These indexes optimize retrieval operations by allowing the database engine to quickly locate and access log entries associated with specific courses or instructors. This is crucial for efficient querying and auditing processes, especially in large datasets, as it reduces the need for full table scans .

Using ENUM for the 'mandatory' field limits the field to predefined values ('yes', 'no'), providing data integrity and enforcing specific rules for this attribute. This choice simplifies decision logic regarding course requirements. However, it limits flexibility if new categories, such as 'conditional', were needed in the future, potentially requiring schema changes to accommodate new values. Thus, while it simplifies current database design, it may require additional planning for evolution or expansion .

Automatic timestamp updates on 'created_at' and 'updated_at' fields enhance data accuracy and reliability by providing a consistent record of when each entry was created and last modified. This automatic management minimizes human error in timestamp entries, ensuring reliable audit trails and accurate historical data. It is particularly important for compliance and performance audits, as it allows for precise tracking of data changes over time, facilitating accountability and transparency in data management practices .

You might also like