There are two data tables with employee information: EMPLOYEE and EMPLOYEE_UIN. Query the tables to generate a list of all employees who are less than 25 years old first in order of NAME, then of ID, both ascending. The result should include the UIN followed by the NAME.
Note: While the secondary sort is by ID, the result includes UIN but not ID.
EMPLOYEE |
||
Name |
Type |
Description |
ID |
Integer |
The I.D of the employee. Primary Key. |
NAME |
String |
The Name of the employee |
AGE |
Integer |
The age of the employee |
ADDRESS |
String |
The address of the employee |
SALARY |
Integer |
The salary of the employee |
EMPLOYEE_UIN |
||
Name |
Type |
Description |
ID |
Integer |
The I.D of the employee. Primary Key. |
UIN |
String |
The unique identification number of the employee |
EMPLOYEE |
||||
ID |
NAME |
AGE |
ADDRESS |
SALARY |
1 |
Sherrie |
23 |
Paris |
30000 |
2 |
Alia |
21 |
Milan |
500000 |
3 |
Najwi |
40 |
Langkawi |
50 |
4 |
Azri |
55 |
London |
50000 |
5 |
Dave |
35 |
Vietnam |
10000 |
EMPLO |
YEE_UIN |
ID |
UIN |
1 |
57520-0440 |
2 |
49638-001 |
3 |
63550-194 |
4 |
68559-6112 |
5 |
63868-453 |
Answer: Query 1: SELECT UIN, NAME FROM EMPLOYEE, EMPLOYEE_UIN WHERE EMPLOYEE.ID = EMPLOYEE_UIN.ID AND AGE < 25 ORDER BY NAME; Explanation: To displayUIN andNAME we put it in SELECT clause. Informa