0% 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.
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)
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.
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
You are on page 1/ 3

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);

You might also like