Skip to content

SQL Server database implementation for language school, featuring student/faculty management, course tracking, and reporting tools

License

Notifications You must be signed in to change notification settings

nabilshadman/sql-server-database-latin-school

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Server Database for Latin School

SQL Server T-SQL Excel

Overview

The Latin School of San Diego is a fictional language school that offers courses in Latin language and culture. It is a small school that has been in operation for about 8 years. They offer new classes on a quarterly basis. Up to now they have been using Excel workbooks to track course offerings, student enrollments and instructor payments. The process has become increasingly unwieldly and the school wants to upgrade to a database backend.

We create a new SQL Server database and migrate the existing Excel data into the database. There are two Excel workbooks, each covering about a 4 year period. We import both workbooks into the database.

Tech Stack

  • Database Engine: Microsoft SQL Server
  • Development Language: T-SQL
  • Development Environment: SQL Server Management Studio (SSMS)
  • Data Migration Source: Microsoft Excel

Requirements

Please refer to this document for the detailed requirements of the project.

Database Structure

Business Logic and Core Entities

There are 4 primary entities to be managed:

  1. Courses

    • Describes content to be taught
    • Defines expected cost and duration
  2. Sections

    • Subset of Course records
    • Contains scheduling and location information
    • Tracks teaching assignments
  3. Persons

    • Student enrollment information
    • School membership records
    • Not all members enroll in courses
  4. Faculty

    • Instructor information
    • Teaching assignments and records

Entity Relationships

The relationships between these entities are as follows:

  • A Course can have multiple Sections, but a Section is related to only one Course
  • A Section can have multiple Faculty and Faculty can teach multiple Sections
  • A Section can have multiple Students and Students can be enrolled in multiple Sections
  • Because there are 2 many-to-many relationships, a linking table will need to be created for each relationship

Supporting Tables

There are 2 lookup/crosswalk tables related to the Section table:

  • A Term table that contains additional information about the term (aka quarter) in which a section is offered
  • A Room table that contains information about the location of a section

Address Management

The school only captured a single address for a person before. The management wanted the ability to capture multiple addresses per person going forward. Each Address record now has an address type of "home" or "work". All existing addresses are assigned a "home" value (per requirements).

Entity Relationship Diagram

entity_relationship_diagram
Figure 1: ERD of the database for latin school.

Additional Database Objects

After creating the tables and importing the data from the Excel workbooks, we implement the following reporting tools:

Views

  • A view that shows the number of times each Course has been offered in the history of the school
  • A view that displays the gross revenue from tuition as well as faculty payments for each Academic Year

Stored Procedures

  • A procedure that displays the course history for a selected person
  • A procedure that adds a new person to the database

Environment Setup

Prerequisites

  1. SQL Server

    • Download and install SQL Server 2019 or later
    • Choose either Developer or Express edition for development purposes
  2. SQL Server Management Studio (SSMS)

    • Download SSMS
    • Version 18.0 or later recommended for full compatibility
  3. Microsoft Excel

    • Required for viewing source data files
    • Excel 2016 or later recommended

Database Configuration

  1. Create a new database in SSMS:
CREATE DATABASE LatinSchool;
GO
USE LatinSchool;
  1. Execute the provided database script

  2. Verify installation by running:

SELECT name FROM sys.databases WHERE name = 'LatinSchool';

Data Migration

  1. Open the Excel workbooks from the latin_school_data directory
  2. Follow the import wizard in SSMS:
    • Right-click on the database
    • Select Tasks → Import Data
    • Choose Microsoft Excel as the data source
    • Map columns to appropriate database tables

Security Setup (Optional)

CREATE LOGIN LatinSchoolUser WITH PASSWORD = 'your_secure_password';
CREATE USER LatinSchoolUser FOR LOGIN LatinSchoolUser;
GRANT SELECT, INSERT, UPDATE ON SCHEMA::dbo TO LatinSchoolUser;

Project Deliverables

We provide the following documents to the management:

Screenshots and Documentation

  • Screenshots of the output from view 1, view 2, procedure 1, and procedure 2
  • A complete .sql file script of the entire database and all database objects
  • A screenshot of an entity relationship diagram showing all table and column names, and the relationships between tables

Usage Scripts

The management can use the following scripts to get the output for the views and stored procedures:

-- View course offerings history
SELECT * FROM CourseRevenue_v ORDER BY CourseCode

-- View annual revenue analysis
SELECT * FROM AnnualRevenue_v ORDER BY AcademicYear

-- Get student course history
EXEC StudentHistory_p 1400

-- Add new person with address
EXEC InsertPerson_p 'LeBron','Jordan','work','3300 Chestnut St.','North Pole'

-- Verify new person and address records
SELECT TOP 1 * FROM Person ORDER BY PersonID DESC
SELECT TOP 1 * FROM Address ORDER BY AddressID DESC

Getting Started

  1. Execute the complete database script to create the schema
  2. Run validation queries to verify table structure
  3. Import historical data using provided migration scripts
  4. Verify data integrity using built-in views
  5. Test stored procedures with sample data

Contributing

We welcome contributions to improve the database schema or add new features. Please submit pull requests or open issues for any enhancements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

SQL Server database implementation for language school, featuring student/faculty management, course tracking, and reporting tools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published