Project 1: Student Information System Database
Project 1: Student Information System Database Architecture
Welcome to your first practical capstone project! In this project, you will step into the shoes of a Lead Database Architect tasked with designing, implementing, and querying a production-ready Student Information System (SIS) for MSK Tech Academy.
This project integrates every concept you have learned across Level 1: DDL database and table creation, constraints, foreign keys, DML data population, multi-column sorting, scalar functions, and aggregation with GROUP BY and HAVING.
1. Project Requirements & Architecture
Our educational institute requires tracking:
- 1Departments / Branches (e.g., Computer Science, Data Science, Cyber Security).
- 2Students (Personal details, enrollment dates, active statuses).
- 3Courses & Enrollments (Course fees, grades, student-course mappings).
+--------------------+ +--------------------+
| departments | | students |
+--------------------+ +--------------------+
| dept_id (PK) | <------- | student_id (PK) |
| dept_name | 1:N | full_name |
+--------------------+ | email (UQ) |
| dept_id (FK) |
| fee_balance |
+--------------------+2. Step 1: Schema Creation (DDL)
Copy and execute this script in MySQL Workbench or CLI:
3. Step 2: Data Population (DML)
4. Step 3: Analytical Business Queries (DQL)
Now, let us write the queries that the academy's executive directors and administrative staff use daily:
5. Capstone Review & Takeaways
You have designed a normalized database from scratch! It features:
- Referential integrity linking students to departments.
- Automatic default values and check constraints enforcing positive fee balances.
- Optimized queries that calculate summaries and filter aggregates cleanly.
Multiple Choice Questions
1. In our student system schema, why is ON DELETE RESTRICT specified on the foreign key linking students to departments?
A. To prevent students from registering B. To prevent an administrator from accidentally deleting a department while enrolled students are still assigned to it C. To encrypt student names D. To make the database read-only Answer: B Explanation: RESTRICT enforces referential integrity by blocking the deletion of any department record that is still referenced by existing student rows.
2. Which constraint guarantees that no two students can register with the exact same email address?
A. CHECK B. UNIQUE C. DEFAULT D. FOREIGN KEY Answer: B Explanation: The UNIQUE constraint on the email column prevents duplicate entries, ensuring each student account has a distinct email.
3. What does TIMESTAMPDIFF(YEAR, date_of_birth, CURDATE()) calculate?
A. The year the student was born B. The exact current age of the student in completed years C. The number of days until graduation D. The total fee balance Answer: B Explanation: TIMESTAMPDIFF(YEAR, date1, date2) accurately calculates the completed number of calendar years elapsed between the two dates.
4. What will happen if an administrative script attempts to insert a student with a negative fee_balance = -500.00?
A. MySQL sets the balance to 0.00 B. The query fails with error 3819 because it violates the chk_positive_balance CHECK constraint C. The student receives a refund D. The table is locked Answer: B Explanation: The CHECK (fee_balance >= 0.00) constraint actively rejects any insertion or update that attempts to store a negative fee balance.
5. In Query 2, what does HAVING COUNT(*) >= 2 accomplish?
A. It filters out departments that have fewer than 2 students from the summary output B. It limits the output to 2 total rows C. It inserts 2 new students D. It sorts the results by 2 Answer: A Explanation: The HAVING clause filters the aggregated department groups, displaying only those containing 2 or more enrolled students.
Project 2: Retail Store Inventory Management System
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Related Lessons
| Previous Lesson | Next Lesson |
|---|---|
| Exporting & Importing CSV Data | Project 2: Retail Store Inventory Management System |
Practice Quiz
Test your understanding of this lesson with 5 questions. Each question has one correct answer.