Skip to main contentSkip to solution

Consider the following tables 'UNIFORM' and 'COST'. Select the correct answer for retriving Ucode, Uname, Ucolor, Size and Price of related tuple of the table 'Uniform' and 'Cost'.

UNIFORM

UcodeUnameUcolor
1ShirtWhite
2PantGrey
3TieBlue

COST

UcodeSizePrice
1L580
1M500
2L890
2M810

Solution

✅ Correct Option: 2

The join condition U.Ucode=C.Ucode pairs each Uniform row only with its related Cost rows. SELECT * returns all the required columns: Ucode, Uname, Ucolor, Size and Price. The result has 4 rows, and Tie (Ucode 3) is left out because it has no cost entry.


Option 1: no join condition, so it gives a Cartesian product of 3×4=123 \times 4 = 12 rows, including unrelated pairs.

Option 3: the join is correct, but it leaves out Ucode and Size, which the question asks for.

Option 4: the - between tables is not valid SQL syntax for a join.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question