0% found this document useful (0 votes)
5 views5 pages

Information and Communication Technology Paper 2 (Sample Paper)

This document is a sample paper for the Hong Kong Diploma of Secondary Education Examination in Information and Communication Technology. It includes instructions for answering questions across three sections, focusing on databases, SQL commands, and database schema design. The paper contains various tasks related to database design, SQL commands, and the explanation of derived attributes.

Uploaded by

sr01lok20230501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Information and Communication Technology Paper 2 (Sample Paper)

This document is a sample paper for the Hong Kong Diploma of Secondary Education Examination in Information and Communication Technology. It includes instructions for answering questions across three sections, focusing on databases, SQL commands, and database schema design. The paper contains various tasks related to database design, SQL commands, and the explanation of derived attributes.

Uploaded by

sr01lok20230501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

SP-DSE

ICT
PAPER 2 HONG KONG EXAMINATIONS AND ASSESSMENT AUTHORITY
HONG KONG DIPLOMA OF SECONDARY EDUCATION EXAMINATION

INFORMATION AND COMMUNICATION TECHNOLOGY PAPER 2


(Sample Paper)

11:15 am – 12:45 pm (1 hour and 30 minutes)


This paper must be answered in English

INSTRUCTIONS

(1) This paper consists of THREE sections, Section A, Section B and Section C. Attempt ALL
questions in any TWO sections.

(2) Write your answers in the DSE(D) Answer Book provided. Start each question (not part of a
question) on a new page.

(3) The last page of this Question Paper contains SQL commands and symbols used in entity-
relationship diagrams which you may find useful.

© 香港考 試 及評 核 局 保留 版 權 Not to be taken away before the


Hong Kong Examinations and Assessment Authority end of the examination session
All Rights Reserved 2022

SP-DSE-ICT 2–1 1
Section A Databases

[DSE 2020 ICT P2A Q.2(b)]


1. Peter designs a database to store information on delivery riders, customers and orders. The requirements of
the database are described below:

The company hires a lot of delivery riders to deliver food to customers. Each customer places one order or
multiple orders. Each delivery rider delivers zero or multiple orders. Each order must be delivered by one
delivery rider only.

Draw the ER diagram for this database with the given entities below. It is not necessary to draw attributes.
(4 marks)

Order

Delivery rider Customer

[Modified from ASCA 2004 Q.1]


2. A database table is created with the following SQL command to store the transaction record of an online
shoe store including transaction ID (TRANID), the type of shoes sold (TYPE) and the size of shoes sold
(SIZE).

CREATE TABLE TRAN (


TRANID CHAR(7) ,
TYPE INTEGER,
SIZE INTEGER )

(a) Give the missing part in the above SQL command so that two records with the same transaction ID
cannot be input into TRAN. (1 mark)

(b) (i) Write an SQL command to input the following transaction record into TRAN. (2 marks)

Transaction number: 0206833


Type of shoes sold: 3
Size of shoes sold: 42

(ii) After the SQL command in (i) was executed, the ordered shoes were found to be out of stock and
hence the transaction was cancelled. What action on the database should be taken? Briefly describe
the purpose of the action. (2 marks)

SP-DSE-ICT 2–2 2
[New question]
3. A database table STAFF stores the attributes DOB (Date of Birth) and AGE (age).

(a) Explain why AGE is a derived attribute. (1 mark)

(b) Give two disadvantages of using this derived attribute. (2 marks)

[Modified from DSE 2020 ICT P2A Q.3(d)]


4. The structure of a database table STUDENT which stores the student records for the school year 2019-2020
is given below.

STUDENT
Field name Description Example
SID Student identity code S117001
NAME Name Chan Tai Man
SEX Sex ( M – Male, F – Female) M
CL Class name 3A
CLNO Class number (1 – 36) 20
Primary key: SID

Extra-curricular activities in the school are classified into different types. The first three types are:
1 Music
2 Sports
3 Visits

Students receive a summary report on the activities they have attended, as shown in the following sample
report:

Extra-curricular Activities Report

Name: Chan Tai Man Sex: M Student ID: S117001 Class: 3A Class number: 20

Date: 22/09/2019
Date: 22/09/2019
Activity: Basketball practice
Activity: Volleyball team meeting
Type: 2
Type: 2
Date: 28/01/2020
Activity: Ocean Park visit
Type: 3

Based on STUDENT and the information in the sample report above, create a database schema in Third
Normal Form. Identify the corresponding primary keys and foreign keys, or write ‘N/A’ if not applicable.
(5 marks)

SP-DSE-ICT 2–3 3
[Modified from DSE 2019 ICT P2A Q.4]
5. A bus company uses three database tables BROUTE, EMPLOYEE and DRIVER to store information on
buses, employees and drivers. DRIVER stores information on the drivers and the bus routes they can drive.

BROUTE
Field name Type Description Example
BID Character The bus route 1A
BNO Integer Number of buses on this bus route 20
Primary Key: BID

EMPLOYEE
Field name Type Description Example
EID Character Identity code of the employee A00038
ENAME Character Name of the employee John Li
SALARY Integer Salary of the employee 20000
DSER Date First day of work 21/3/2010
Primary Key: EID

DRIVER
Field name Type Description Example
EID Character Identity code of the employee A00038
BID Character The bus route that the employee can drive 1A
Primary key: EID + BID
Foreign key: EID , BID

Write SQL commands to complete tasks (a) to (c) below.

(a) List the names and identity codes of the employees who can drive bus route ‘1A’ in descending order
of their salary. (2 marks)

(b) List the names and identity codes of the employees who cannot drive any bus route. (2 marks)

(c) For some bus routes, the number of drivers is smaller than the number of buses. List those bus routes.
(3 marks)

SP-DSE-ICT 2–4 4
(d) Consider the following views:

CREATE VIEW V1 AS
SELECT AVG(SALARY) AS AVG1 FROM EMPLOYEE
WHERE EID IN
(SELECT DRIVER.EID FROM DRIVER
WHERE DSER < '1/1/2005')

CREATE VIEW V2 AS
SELECT AVG(SALARY) AS AVG2 FROM EMPLOYEE
WHERE EID IN
(SELECT DRIVER.EID FROM DRIVER
WHERE DSER >= '1/1/2005')

(i) What is the purpose of V1? (2 marks)

(ii) Write a SQL command to find (AVG1 - AVG2). (2 marks)

(e) A field BUSID is added to DRIVER to record the car plate number of the bus driven by an employee.
The car plate number contains at most 6 characters. Write a SQL command to add the field.
(2 marks)

END OF SECTION A

SP-DSE-ICT 2–5 5

You might also like