Standard Interview Questions
SQL Skills
Exercise 1: How many courses is each faculty is teaching? The query should also
display faculty's that are not taking any courses.
Exercise 1.1: Modify the query to display only those faculties whose name starts
with A.
Exercise 1.2: Modify the query from Exercise 1 to show only those facultys teaching
more than 5 courses.
Faculty
Faculty_ID
Faculty_Na
me
Faculty_De
pt
(PK)
Course_det
ail
Course_ID
Course_Nam
e
Course_start
_dt
Faculty_Id
(PK)
Exercise 2:
What is the largest store in each city?
STORE
City
Baltimore
Silver Spring
DC
Store
A
B
C
D
E
F
G
Size (sqft
000)
Assumption: Table Name = store
20
15
5
12
20
22
9
Exercise 3:
What is the current status and turnaround time(time taken to close the ticket) for
each service ticket?
QA
Exercise 1: Please describe some of the standard test cases that you would writeto
test a FACT table.
Dimension tables: All data is loaded initially and then incremental loads every day
for new/updated records
Fact table: Data loaded incrementally every day
Exercise 2: Lets say we have a source table Person and a target dimention table
Dim_Person. Dim_Person is loaded on daily basis via an ETL tool.Its a straight pull.
You are asked to validate the Dim_Person and you find out that there are
discrepencies in the no: of records from source to target. What steps you would
take to figure out where the discrepencies are.
Only current data in dimensional table:
we need to compare target data with source data, (no history is maintained)
minus query
select * from persons
minus
select * from dim_persons =0 rows
Historical data in dimensional table:
1)we need to have only one active record for every id in dim_persons
2)we need to have active record with end_date null in dim_persons
3)we need to make sure the existing record end_date and active indicator is
updated, with new rows help