{"id":15062554,"url":"https://github.com/melvinmo/db_lab_archive","last_synced_at":"2026-02-06T17:31:37.620Z","repository":{"id":191551256,"uuid":"684888100","full_name":"MelvinMo/DB_Lab_Archive","owner":"MelvinMo","description":"This repository houses the course materials for my undergraduate database design lab, encompassing assignments and a final project on designing an automotive sales database.","archived":false,"fork":false,"pushed_at":"2023-08-30T04:29:05.000Z","size":25387,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T00:46:49.662Z","etag":null,"topics":["ado-net","csharp","data-management","microsoft-sql-server","sql","tsql"],"latest_commit_sha":null,"homepage":"","language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MelvinMo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-30T03:59:10.000Z","updated_at":"2023-08-30T04:32:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"7544796c-89c5-4465-a9ff-28a50534380f","html_url":"https://github.com/MelvinMo/DB_Lab_Archive","commit_stats":null,"previous_names":["melvinmo/db_lab_archive"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MelvinMo/DB_Lab_Archive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelvinMo%2FDB_Lab_Archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelvinMo%2FDB_Lab_Archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelvinMo%2FDB_Lab_Archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelvinMo%2FDB_Lab_Archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MelvinMo","download_url":"https://codeload.github.com/MelvinMo/DB_Lab_Archive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelvinMo%2FDB_Lab_Archive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29170081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ado-net","csharp","data-management","microsoft-sql-server","sql","tsql"],"created_at":"2024-09-24T23:42:46.931Z","updated_at":"2026-02-06T17:31:37.601Z","avatar_url":"https://github.com/MelvinMo.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DB_Lab_Archive\nThis repository houses the course materials for my undergraduate database design lab, encompassing assignments and a final project on designing an automotive sales database.\n## Assignments\n### Lab 1\nThis lab focuses on database schema design by defining tables, columns, keys, and relationships, as well as inserting sample data using INSERT statements and basic SELECT queries to retrieve data.\n\n### Lab 2\nThis lab covers more advanced SELECT statements, including multi-table joins, aggregate functions like COUNT and MAX, nested subqueries, and UPDATE statements to modify data.\n\n### Lab 3\nThis lab demonstrates SQL Server administration concepts like creating logins, users, server roles, and assigning permissions, as well as using SELECT INTO to copy data into a new table.\n\n### Lab 4\nThis lab practices GROUP BY queries with ROLLUP to generate grouped summary reports, JOINs across multiple related tables, and subqueries to count records matching a condition.\n\n### Lab 5\nThis lab explores data pivoting by rotating rows into columns for reporting using PIVOT, string manipulation functions like LEN, LEFT, RIGHT, and SUBSTRING, and user-defined functions including a scalar UDF to convert dates and a table-valued UDF to return result sets.\n\n### Lab 6\nThis lab focuses on DML triggers, inserts sample data to fire the triggers, and logs changes to a separate audit table. It also uses SELECT INTO to copy data to a new table and a stored procedure to compare and find differences between the tables.\n\n### Lab 7\nThis lab covers the bcp utility for bulk import and export of data between SQL Server and text files. It exports a table to text, imports it into a new table, exports a query result to text, and exports a table to a .dat file.\n\n### Lab 8\nThis lab demonstrates transaction isolation levels and concurrency issues like dirty reads and non-repeatable reads using BEGIN TRAN, COMMIT, and SET TRANSACTION ISOLATION LEVEL statements.\n\n## Project\n\"Carstock\" is an automotive sales database, a robust and comprehensive system specifically designed for a global auto sales company. Its primary objective is to facilitate the seamless buying and selling of vehicles by providing a centralized platform for both customers and suppliers. The database schema, implemented using Microsoft SQL Server, includes well-defined tables to store crucial data related to vehicles, customers, suppliers, sales transactions, and other relevant entities.\n\nTo ensure the integrity and efficiency of the database, relationships between tables were established using primary keys and foreign keys. This allowed for proper data organization and efficient retrieval of interconnected information. Additionally, a substantial amount of sample data, comprising over 200,000 records, was generated and populated across the various entities.\n\nIn order to encapsulate business logic and gain valuable insights from the data, several database objects were implemented. These included the creation of views, which allowed for the retrieval of consolidated vehicle and customer details, as well as functions that enabled the filtering of cars based on color, mileage, and other specifications. Triggers were also utilized to enforce data integrity rules, ensuring that the database maintained consistent and reliable information.\n\nTo showcase the practical usage of the database, a user-friendly graphical user interface (GUI) was developed using C# with ADO.NET. This GUI provided a seamless and intuitive way for users to interact with the database objects. Users could easily browse the full inventory, check for available cars, explore offers, make purchases, and list vehicles for sale. The GUI effectively demonstrated the practical application of the database system in real-world scenarios.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelvinmo%2Fdb_lab_archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelvinmo%2Fdb_lab_archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelvinmo%2Fdb_lab_archive/lists"}