SQL, ETL

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play

1/14

encourage image

There are no tags or description

Looks like no tags are added yet.

15 Terms

1
New cards

What is ETL?

• Extract: retrieve data from source systems • Transform: clean, standardize, join, restructure • Load: place processed data into destination for analysis

2
New cards

Difference between ETL and ELT?

• ETL: transform before loading • ELT: load raw data first, then transform inside destination system

3
New cards

What is data validation?

• Check accuracy • Check completeness • Check consistency • Check expected rules • Look for missing values, duplicates, invalid types, unexpected amounts, reconciliation failures

4
New cards

How would you validate an ETL pipeline?

• Compare source and destination record counts • Check transferred fields • Validate joins and transformations • Look for missing or duplicate records • Reconcile key totals • Test edge cases • Document exceptions

5
New cards

What is a SQL JOIN?

• Combines rows from multiple tables • Uses related columns • Example: join invoices to customers using customer_id

6
New cards

INNER JOIN vs LEFT JOIN?

• INNER JOIN: only matching records in both tables • LEFT JOIN: all left-table records plus matching right-table records • Unmatched right-side values become NULL

7
New cards

What is GROUP BY?

• Groups rows sharing values in specified columns • Allows aggregate functions by group • Example: total transaction amount per customer

8
New cards

WHERE vs HAVING?

• WHERE filters rows before aggregation • HAVING filters groups after GROUP BY

9
New cards

COUNT(*) vs COUNT(column)?

• COUNT(*): counts every row • COUNT(column): counts only non-NULL values in that column

10
New cards

What is a primary key?

• Uniquely identifies each record • One column or combination of columns • No duplicate or NULL values

11
New cards

What is a foreign key?

• References a primary key in another table • Establishes table relationships • Supports referential integrity

12
New cards

What is NULL?

• Missing or unknown value • Not equivalent to zero or empty string • Use IS NULL or IS NOT NULL

13
New cards

How would you identify duplicate transactions?

• Group by fields expected to uniquely identify transactions • Use COUNT(*) • Look for groups with more than one record • If no unique ID, compare customer, amount, date, reference • Investigate matches before calling them duplicates

14
New cards

How would you investigate missing records between systems?

• Compare record counts • Use LEFT JOIN or anti-join • Identify records present in one system but missing in another • Check timing differences • Check filters • Check identifier formatting • Check failed transformations

15
New cards

How would you approach an unfamiliar dataset?

• Understand business purpose • Review field definitions and schema • Inspect data types and record counts • Check missing values and duplicates • Examine table relationships • Identify keys • Validate a small sample first