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 |
|
Complete collection of BI track materials, projects, and resources.
๐ก Database Tip
Pro Tip: Always BACKUP before you ALTER!
| Situation | Backup Type | Risk Level |
|---|
| Before ALTER TABLE | Full DB | โ ๏ธโ ๏ธโ ๏ธโ ๏ธโ ๏ธ |
| Before running DELETE | Transaction Log | โ ๏ธโ ๏ธโ ๏ธ |
| Before Power BI refresh | .pbix File | โ ๏ธโ ๏ธโ ๏ธโ ๏ธ |
| Before Projects submission | Both .bak and .sql | โ ๏ธโ ๏ธโ ๏ธโ ๏ธโ ๏ธ |
๐งผ Writing Clean SQL โ Make your queries readable
โGood code is its own best documentation.โ โ Steve McConnell
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
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;