{"id":23116321,"url":"https://github.com/nabilshadman/sql-server-database-latin-school","last_synced_at":"2025-04-04T01:25:45.377Z","repository":{"id":176914075,"uuid":"377471417","full_name":"nabilshadman/sql-server-database-latin-school","owner":"nabilshadman","description":"SQL Server database implementation for language school, featuring student/faculty management, course tracking, and reporting tools","archived":false,"fork":false,"pushed_at":"2024-12-04T19:16:12.000Z","size":3362,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T13:13:01.433Z","etag":null,"topics":["data-engineering","database","excel","microsoft-sql","sql-server","sql-server-management-studio","t-sql","tsql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nabilshadman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-16T11:24:23.000Z","updated_at":"2024-12-04T19:16:16.000Z","dependencies_parsed_at":"2024-12-03T13:33:36.736Z","dependency_job_id":"50c5127b-6e13-4b07-8033-674b67b84f7d","html_url":"https://github.com/nabilshadman/sql-server-database-latin-school","commit_stats":null,"previous_names":["nabilshadman/sql-server-database-latin-school"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fsql-server-database-latin-school","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fsql-server-database-latin-school/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fsql-server-database-latin-school/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fsql-server-database-latin-school/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabilshadman","download_url":"https://codeload.github.com/nabilshadman/sql-server-database-latin-school/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247105353,"owners_count":20884424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-engineering","database","excel","microsoft-sql","sql-server","sql-server-management-studio","t-sql","tsql"],"created_at":"2024-12-17T04:15:59.505Z","updated_at":"2025-04-04T01:25:45.350Z","avatar_url":"https://github.com/nabilshadman.png","language":null,"readme":"# SQL Server Database for Latin School\n\n[![SQL Server](https://img.shields.io/badge/SQL%20Server-2019-CC2927?logo=microsoft-sql-server\u0026logoColor=white)](https://www.microsoft.com/sql-server)\n[![T-SQL](https://img.shields.io/badge/T--SQL-Latest-blue)](https://docs.microsoft.com/sql)\n[![Excel](https://img.shields.io/badge/Excel-Compatible-217346?logo=microsoft-excel\u0026logoColor=white)](https://products.office.com/excel)\n\n## Overview\n\nThe **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.\n\nWe create a new **SQL Server** [database](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/sql_server_database/sql_server_database_script.sql) and migrate the existing **Excel** [data](https://github.com/nabilshadman/sql-server-database-latin-school/tree/main/latin_school_data) into the database. There are two Excel workbooks, each covering about a 4 year period. We import both workbooks into the database.\n\n## Tech Stack\n\n- **Database Engine:** Microsoft SQL Server\n- **Development Language:** T-SQL\n- **Development Environment:** SQL Server Management Studio (SSMS)\n- **Data Migration Source:** Microsoft Excel\n\n## Requirements\n\nPlease refer to [this](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/requirements/project_requirements.pdf) document for the detailed **requirements** of the project.\n\n## Database Structure\n\n### Business Logic and Core Entities\n\nThere are **4 primary entities** to be managed:\n\n1. **Courses**\n   - Describes content to be taught\n   - Defines expected cost and duration\n   \n2. **Sections**\n   - Subset of Course records\n   - Contains scheduling and location information\n   - Tracks teaching assignments\n\n3. **Persons**\n   - Student enrollment information\n   - School membership records\n   - Not all members enroll in courses\n\n4. **Faculty**\n   - Instructor information\n   - Teaching assignments and records\n\n### Entity Relationships\n\nThe **relationships** between these entities are as follows:\n- A Course can have multiple Sections, but a Section is related to only one Course\n- A Section can have multiple Faculty and Faculty can teach multiple Sections\n- A Section can have multiple Students and Students can be enrolled in multiple Sections\n- Because there are 2 many-to-many relationships, a linking table will need to be created for each relationship\n\n### Supporting Tables\n\nThere are 2 **lookup/crosswalk** tables related to the Section table:\n- A Term table that contains additional information about the term (aka quarter) in which a section is offered\n- A Room table that contains information about the location of a section\n\n### Address Management\n\nThe 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).\n\n### Entity Relationship Diagram\n\n![entity_relationship_diagram](https://github.com/nabilshadman/sql-server-database-latin-school/assets/13073461/b6f69009-ec3e-4bdc-a716-d0a4694ef2b5)  \n**Figure 1:** ERD of the database for latin school.\n\n## Additional Database Objects\n\nAfter creating the tables and importing the data from the Excel workbooks, we implement the following reporting tools:\n\n### Views\n- A **view** that shows the number of times each Course has been offered in the history of the school\n- A **view** that displays the gross revenue from tuition as well as faculty payments for each Academic Year\n\n### Stored Procedures\n- A **procedure** that displays the course history for a selected person\n- A **procedure** that adds a new person to the database\n\n\n## Environment Setup\n\n### Prerequisites\n1. **SQL Server**\n   - Download and install [SQL Server 2019](https://www.microsoft.com/sql-server/sql-server-2019) or later\n   - Choose either Developer or Express edition for development purposes\n\n2. **SQL Server Management Studio (SSMS)**\n   - Download [SSMS](https://docs.microsoft.com/sql/ssms/download-sql-server-management-studio-ssms)\n   - Version 18.0 or later recommended for full compatibility\n\n3. **Microsoft Excel**\n   - Required for viewing source data files\n   - Excel 2016 or later recommended\n\n### Database Configuration\n1. Create a new database in SSMS:\n```sql\nCREATE DATABASE LatinSchool;\nGO\nUSE LatinSchool;\n```\n\n2. Execute the provided [database script](sql_server_database/sql_server_database_script.sql)\n\n3. Verify installation by running:\n```sql\nSELECT name FROM sys.databases WHERE name = 'LatinSchool';\n```\n\n### Data Migration\n1. Open the Excel workbooks from the [latin_school_data](latin_school_data) directory\n2. Follow the import wizard in SSMS:\n   - Right-click on the database\n   - Select Tasks → Import Data\n   - Choose Microsoft Excel as the data source\n   - Map columns to appropriate database tables\n\n### Security Setup (Optional)\n```sql\nCREATE LOGIN LatinSchoolUser WITH PASSWORD = 'your_secure_password';\nCREATE USER LatinSchoolUser FOR LOGIN LatinSchoolUser;\nGRANT SELECT, INSERT, UPDATE ON SCHEMA::dbo TO LatinSchoolUser;\n```\n\n\n## Project Deliverables\n\nWe provide the following **documents** to the management:\n\n### Screenshots and Documentation\n- Screenshots of the output from [view 1](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/sql_server_database/view_1.jpg), [view 2](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/sql_server_database/view_2.jpg), [procedure 1](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/sql_server_database/procedure_1.jpg), and [procedure 2](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/sql_server_database/procedure_2.jpg)\n- A complete [.sql](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/sql_server_database/sql_server_database_script.sql) file script of the entire database and all database objects\n- A screenshot of an entity relationship [diagram](https://github.com/nabilshadman/sql-server-database-latin-school/blob/main/sql_server_database/entity_relationship_diagram.jpg) showing all table and column names, and the relationships between tables\n\n### Usage Scripts\n\nThe management can use the following **scripts** to get the output for the views and stored procedures:\n\n```sql\n-- View course offerings history\nSELECT * FROM CourseRevenue_v ORDER BY CourseCode\n\n-- View annual revenue analysis\nSELECT * FROM AnnualRevenue_v ORDER BY AcademicYear\n\n-- Get student course history\nEXEC StudentHistory_p 1400\n\n-- Add new person with address\nEXEC InsertPerson_p 'LeBron','Jordan','work','3300 Chestnut St.','North Pole'\n\n-- Verify new person and address records\nSELECT TOP 1 * FROM Person ORDER BY PersonID DESC\nSELECT TOP 1 * FROM Address ORDER BY AddressID DESC\n```\n\n## Getting Started\n\n1. Execute the complete database script to create the schema\n2. Run validation queries to verify table structure\n3. Import historical data using provided migration scripts\n4. Verify data integrity using built-in views\n5. Test stored procedures with sample data\n\n\n## Contributing\n\nWe welcome contributions to improve the database schema or add new features. Please submit pull requests or open issues for any enhancements. \n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE.txt) file for details.  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilshadman%2Fsql-server-database-latin-school","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabilshadman%2Fsql-server-database-latin-school","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilshadman%2Fsql-server-database-latin-school/lists"}