Back
to Tylogix Home Page
A Simple SQL Join
Skill Test
Part 1: Questions
Let there be two files:
- FILEA with 100 rows with a numeric unique key
spanning from 1 to 100.
- FILEB with 10 rows with a numeric unique key
spanning from 1 to 10.
- TABLEA
|
- TABLEB
|
1
2
3
.
.
.
.
100
|
1
2
3
.
.
.
10
|
Using the keys above:
- TABLEA EXCEPTION JOIN TABLEB should yield
how many rows?
- TABLEB EXCEPTION JOIN TABLEA should yield
how many rows?
- TABLEA INNER JOIN TABLEB should yield
how many rows?
- TABLEB INNER JOIN TABLEA should yield
how many rows?
- TABLEA LEFT OUTER JOIN TABLEB should yield
how many rows?
- TABLEA LEFT OUTER JOIN TABLEB should yield
how many NULL values?
- TABLEB LEFT OUTER JOIN TABLEA should yield
how many rows?
- 8. If TABLEA had a numeric key and TABLEB had numbers in a
character field, is there a way to still do the join?
Expected answer: Yes, with a
“CAST” operation.
Let there be two files:
- PLANT_TABLE with 10 rows
with a numeric unique key spanning from 1 to 10.
- ITEM_TABLE with 3 rows
with numeric unique keys 123, 456, 789
PLANT_TABLE
|
ITEM_TABLE
|
1
2
3
.
.
.
10
|
123
456
789
|
- PLANT_TABLE CROSS JOIN ITEM_TABLE would yield
how many rows?
Click Here to see the
answers
Back
to Tylogix Home Page