ITECH - 1103 - Mid - Sem - Test
ITECH - 1103 - Mid - Sem - Test
ITECH - 1103 - Mid - Sem - Test
a) You can decide the names for entities, attributes and relations, but you should use
UPPERCASE to name your entities and use Capitalisation to name attributes of entities.[3
Marks]
b) Underline all primary key attributes, and put (f.k) next to all the foreign key attributes. [1
Mark]
c) Clearly indicate cardinalities between entities. [1 Mark]
Answer:
Page 1 of 3
2. SQL [50 marks]
Page 2 of 3
2. Display the details of the employees who were hired between 1-June-1992 and 15-december-1993
Answer: SELECT *
FROM EMPLOYEE
WHERE HireDate BETWEEN ‘1992-06-01’ AND ‘1993-12-15’;
FROM EMPLOYEE
GROUP BY City
4. Display the names of the employee whom last name ends with letter n.[1 mark]
Answer: SELECT First Name, LastName
FROM EMPLOYEE
5. Show the name of all of the employees in one column, in the format first name last name (eg Fred
Smith) [1 mark]
Answer SELECT CONCAT (FirstName, ‘ ‘ ,LastName )
FROM EMPLOYEE;
Page 3 of 3