ITI SQL Labs - Complete Solutions

May 25, 2025 ยท View on GitHub

Database Gif
ITI Logo

๐Ÿ“‹ Repository Description

ITI DB-SQL Labs Answers by me, featuring:

  • Lab Folders: Each lab is organized into its own folder, containing:
  • SQL Scripts: Detailed solutions for each lab exercise.
  • Backup Files: .bak files for restoring the database state pertinent to each lab.
  • Resources: Additional materials to supplement your learning.

Based On Lectures
Helpful Notes

๐Ÿš€ Full Power BI Track Materials


Complete collection of BI track materials, projects, and resources.
๐Ÿ’ก Database Tip
Pro Tip: Always BACKUP before you ALTER!
SituationBackup TypeRisk Level
Before ALTER TABLEFull DBโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธ
Before running DELETETransaction Logโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธ
Before Power BI refresh.pbix Fileโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธ
Before Projects submissionBoth .bak and .sqlโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธโ˜ ๏ธ

๐Ÿงผ Writing Clean SQL โ€“ Make your queries readable
โ€œGood code is its own best documentation.โ€ โ€“ Steve McConnell

โŒ Before (Spaghetti Code)

select c.customer_id,c.first_name,c.last_name,o.order_id,o.order_date 
from customers c join orders o on c.customer_id=o.customer_id 
where c.country='germany' and o.quantity>100

โœ… After (Clean & Readable)

SELECT
    c.customer_id,
    c.first_name,
    c.last_name,
    o.order_id,
    o.order_date
FROM customers c
INNER JOIN orders o
    ON c.customer_id = o.customer_id
WHERE c.country = 'Germany'
    AND o.quantity > 100;