{"id":29040468,"url":"https://github.com/ani811625/csi-assignment2","last_synced_at":"2025-10-16T20:24:01.464Z","repository":{"id":299028294,"uuid":"1001862852","full_name":"Ani811625/CSI-Assignment2","owner":"Ani811625","description":"📊 SQL queries built on the AdventureWorks2022 database. Includes stored procedures, views, triggers, functions, and sample test queries for an order management system.","archived":false,"fork":false,"pushed_at":"2025-06-15T07:58:07.000Z","size":813,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-20T11:45:58.330Z","etag":null,"topics":["adventureworks","microsoft-sql-server","sql"],"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/Ani811625.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-14T07:32:28.000Z","updated_at":"2025-06-15T07:58:11.000Z","dependencies_parsed_at":"2025-08-20T11:35:14.298Z","dependency_job_id":"0bfe6879-ff2f-4da1-b428-a56c6a25e40c","html_url":"https://github.com/Ani811625/CSI-Assignment2","commit_stats":null,"previous_names":["ani811625/csi-assignment2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ani811625/CSI-Assignment2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ani811625%2FCSI-Assignment2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ani811625%2FCSI-Assignment2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ani811625%2FCSI-Assignment2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ani811625%2FCSI-Assignment2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ani811625","download_url":"https://codeload.github.com/Ani811625/CSI-Assignment2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ani811625%2FCSI-Assignment2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278437956,"owners_count":25986760,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["adventureworks","microsoft-sql-server","sql"],"created_at":"2025-06-26T14:05:43.537Z","updated_at":"2025-10-05T09:43:27.044Z","avatar_url":"https://github.com/Ani811625.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSI-Assignment2\n\n# 💼 Celebal Technologies Internship – Level B SQL Assignment\n\nThis repository contains the complete solution to the **Level B SQL Task**, assigned as part of the **Week 2 deliverables** during the **Summer Internship Program at Celebal Technologies**.\n\n---\n## ✅ Overview of Implemented SQL Components\n### 🔧 Stored Procedures\n- `InsertOrderDetails`: Validates stock and inserts order lines.\n- `UpdateOrderDetails`: Updates fields with NULL-safety and adjusts inventory.\n- `GetOrderDetails`: Fetches order line items by OrderID.\n- `DeleteOrderDetails`: Removes a specific product from an order with validation.\n\n### 🧮 Scalar Functions\n- `fn_FormatDate_MMDDYYYY`: Converts DATETIME to MM/DD/YYYY.\n- `fn_FormatDate_YYYYMMDD`: Converts DATETIME to YYYYMMDD.\n\n### 👁️ Views\n- `vwCustomerOrders`: Shows order details with customer and product info.\n- `vwCustomerOrders_Yesterday`: Filters the above view for yesterday's orders.\n- `MyProducts`: Lists non-discontinued products with vendor and category info.\n\n### 🔥 Triggers\n- `trg_InsteadOfDeleteSalesOrder`: Deletes dependent order details before order.\n- `trg_CheckStockBeforeInsert`: Prevents insert when stock is insufficient and updates inventory on success.\n\n## 🛠️ Technologies \u0026 Tools Used\n\n- **SQL Server 2022 Express / Developer Edition**\n- **SQL Server Management Studio (SSMS)**\n- **AdventureWorks2022 OLTP Sample Database**\n\n\u003e ✔️ All queries are designed and tested using the default schema structure of the **AdventureWorks2022** database available from Microsoft's official GitHub repository along with Custom Sample Database Schema.\n\n---\n\n## 💾 How to Use This Project\n\n### 1. Prerequisites\n- Microsoft SQL Server (2019 or later)\n- SQL Server Management Studio (SSMS)\n- `AdventureWorks2022` OLTP database restored on your SQL Server\n\n### 2. Execution Steps\n-- Run the script AdventureWorks_LevelB_Task.sql\n---\n## 🛠️ Technologies \u0026 Tools Used\n\n- **SQL Server 2022 Express / Developer Edition**\n- **SQL Server Management Studio (SSMS)**\n- **AdventureWorks2022 OLTP Sample Database**\n\n\u003e ✔️ All queries are designed and tested using the default schema structure of the **AdventureWorks2022** database available from Microsoft's official GitHub repository.\n\n---\n\n## 📁 Repository Structure\n```plaintext\n📂 AdventureWorks2022/\n│      ├── 📂 Functions/\n│      │        ├── FormatDate_MMDDYYYY.sql\n│      │        └── FormatDate_YYYYMMDD.sql\n│      ├── 📂 Stored procedures/\n│      │        ├── DeleteOrderDetails.sql\n│      │        ├── GetOrderDetails.sql\n│      │        ├── InsertOrderDetails.sql\n│      │        └── UpdateOrderDetails.sql\n│      ├── 📂 Triggers/\n│      │        ├── trg_CheckStockBeforeInsert.sql\n│      │        └── trg_InsteadOfDeleteSalesOrder.sql\n│      └── 📂 Views/\n│               ├── MyProducts.sql\n│               ├── vwCustomerOrders.sql\n│               └── vwCustomerOrders_Yesterday.sql\n│\n├── AdventureWorks_LevelB_Task.sql\n│\n├── Level B Task.pdf\n│\n└── README.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fani811625%2Fcsi-assignment2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fani811625%2Fcsi-assignment2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fani811625%2Fcsi-assignment2/lists"}