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
Ucode Uname Ucolor 1 Shirt White 2 Pant Grey 3 Tie Blue
COST
Ucode Size Price 1 L 580 1 M 500 2 L 890 2 M 810
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
| Ucode | Uname | Ucolor |
|---|---|---|
| 1 | Shirt | White |
| 2 | Pant | Grey |
| 3 | Tie | Blue |
COST
| Ucode | Size | Price |
|---|---|---|
| 1 | L | 580 |
| 1 | M | 500 |
| 2 | L | 890 |
| 2 | M | 810 |
Solution
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 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.
Related questions:
2026: 23 May Shift 2
2026: 26 May Shift 1
2026: 13 May Shift 2
2026: 24 May Shift 1