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.
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 ratings0% found this document useful (0 votes)
2 views3 pages
Document Blank
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.
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,
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);