Loading repository dataโฆ
Loading repository dataโฆ
Ani811625 / repository
๐ SQL queries built on the AdventureWorks2022 database. Includes stored procedures, views, triggers, functions, and sample test queries for an order management system.
This 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.
InsertOrderDetails: Validates stock and inserts order lines.UpdateOrderDetails: Updates fields with NULL-safety and adjusts inventory.GetOrderDetails: Fetches order line items by OrderID.DeleteOrderDetails: Removes a specific product from an order with validation.fn_FormatDate_MMDDYYYY: Converts DATETIME to MM/DD/YYYY.fn_FormatDate_YYYYMMDD: Converts DATETIME to YYYYMMDD.vwCustomerOrders: Shows order details with customer and product info.vwCustomerOrders_Yesterday: Filters the above view for yesterday's orders.MyProducts: Lists non-discontinued products with vendor and category info.trg_InsteadOfDeleteSalesOrder: Deletes dependent order details before order.trg_CheckStockBeforeInsert: Prevents insert when stock is insufficient and updates inventory on success.โ๏ธ 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.
AdventureWorks2022 OLTP database restored on your SQL Serverโ๏ธ All queries are designed and tested using the default schema structure of the AdventureWorks2022 database available from Microsoft's official GitHub repository.
๐ AdventureWorks2022/
โ โโโ ๐ Functions/
โ โ โโโ FormatDate_MMDDYYYY.sql
โ โ โโโ FormatDate_YYYYMMDD.sql
โ โโโ ๐ Stored procedures/
โ โ โโโ DeleteOrderDetails.sql
โ โ โโโ GetOrderDetails.sql
โ โ โโโ InsertOrderDetails.sql
โ โ โโโ UpdateOrderDetails.sql
โ โโโ ๐ Triggers/
โ โ โโโ trg_CheckStockBeforeInsert.sql
โ โ โโโ trg_InsteadOfDeleteSalesOrder.sql
โ โโโ ๐ Views/
โ โโโ MyProducts.sql
โ โโโ vwCustomerOrders.sql
โ โโโ vwCustomerOrders_Yesterday.sql
โ
โโโ AdventureWorks_LevelB_Task.sql
โ
โโโ Level B Task.pdf
โ
โโโ README.md