QB CP02 Eng

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 18

Chapter 2 Data Organization and Data Control

Multiple Choice Questions

P02M001
John is asked to enter the name of a customer, Molly, into a database. However, he
accidentally entered ‘M0lly’ instead. Which of the following types of errors has he made?
A. Data source error
B. Transcription error
C. Transposition error
D. Parity error
Answer
B

P02M002
Which of the following is a transposition error?
A. 9234o987
B. hil1
C. mary
D. hapyp
Answer
D

P02M003
Only numbers between 0 and 99 are allowed to be entered into a field. Which of the
following validity checks should be enforced?
A. Field length check
B. Format check
C. Check digit
D. Range check
Answer
D

P02M004
After a data validation rule has been applied, a field can only be entered with English letters.
Which of the following validity checks has been implemented?
A. Type check
B. Range check
© Pearson Education Asia Limited 2009 1 NSS ICT Compulsory Question Bank
C. Field length check
D. Format check
Answer
A

P02M005
After a data validation rule has been applied, a field can only be entered with ‘M’ or ‘F’.
Which of the following validity checks has been implemented?
A. Field length check
B. Fixed value check
C. Range check
D. Format check
Answer
B

P02M006
Which of the following measures is/are related to data verification?
(1) Check digit
(2) Inputting data twice
(3) Double data entry
A. (1) only
B. (2) only
C. (1) and (3) only
D. (2) and (3) only
Answer
A

P02M007
A check digit, ‘1’, is appended to the end of the binary number ‘10011010’. Which of the
following types of check digit is used?
A. Odd parity check
B. Even parity check
C. Modulo-7
D. Modulo-11
Answer
A

P02M008
Which of the following shows the descending order of data hierarchy of a database?
© Pearson Education Asia Limited 2009 2 NSS ICT Compulsory Question Bank
A. Field > table > database > record
B. Table > database > field > record
C. Database > table > record > field
D. Record > field > table > database
Answer
C

P02M009
Which of the following is/are function(s) of a DBMS?
(1) Managing database structures
(2) Storing and organizing data in a database
(3) Verifying whether data is entered correctly
A. (1) only
B. (3) only
C. (1) and (2) only
D. (1), (2) and (3)
Answer
C

P02M010
Which of the following statements about data indexing is/are correct?
(1) An index can speed up data access.
(2) A table can have more than one index.
(3) An index file does not need to be updated when the data in the related table is modified.
A. (1) only
B. (3) only
C. (1) and (2) only
D. (1), (2) and (3)
Answer
C

P02M011
Which of the following is/are the function(s) of a DBMS?
(1) Data filtering
(2) Data indexing
(3) Data sorting
A. (1) only
B. (3) only
C. (1) and (2) only
© Pearson Education Asia Limited 2009 3 NSS ICT Compulsory Question Bank
D. (1), (2) and (3)
Answer
D

P02M012
Which of the following statements about query forms is/are correct?
(1) They can be stored and are reusable.
(2) They can show data from one table only.
(3) They can print results in specified formats.
A. (1) only
B. (3) only
C. (1) and (2) only
D. (1), (2) and (3)
Answer
A

P02M013
Which of the following mappings concerning data hierarchy is not correct?
Level Example
A. Field Name
B. Table Teacher remarks for students
C. Database All student information in a school
D. Record The information of a student
Answer
B

P02M014
Which of the following devices operates in sequential access mode?
A. DVD
B. Data tape
C. Floppy disk
D. USB flash drive
Answer
B

P02M015
Which of the following statements about data access is/are correct?
(1) Hard disks operate in direct access mode.

© Pearson Education Asia Limited 2009 4 NSS ICT Compulsory Question Bank
(2) Sequential access mode is not used in storage devices any more due to its inferior
performance.
(3) Not all the devices operating in direct access mode store data in hard disks.
A. (1) only
B. (3) only
C. (1) and (3) only
D. (1), (2) and (3)
Answer
C

P02M016
Which of the following is not a method of collecting data?
A. Questionnaire
B. Experiment
C. Observation
D. Verification
Answer
D

P02M017
A computer operator enters a date as ‘11/1/1989’ instead of ‘1/11/1989’ in ‘day/month/year’
format. He can use _____________ to detect the error.
A. check digit
B. length check
C. data verification
D. field presence check
Answer
C

P02M018
A computer operator enters a date as ‘1/13/1989’ instead of ‘1/11/1989’ in ‘day/month/year’
format. He can use _____________ to detect the error.
A. range check
B. check digit
C. length check
D. field presence check
Answer
A

© Pearson Education Asia Limited 2009 5 NSS ICT Compulsory Question Bank
P02M019
A computer operator enters a telephone number as ‘22i7O456’ instead of ‘22170456’. He
can use _____________ to detect the error.
A. range check
B. check digit
C. length check
D. type check
Answer
D

P02M020
A computer operator enters a telephone number as ‘2217333’ instead of ‘22173333’. He can
use _____________ to detect the error.
A. range check
B. check digit
C. length check
D. type check
Answer
C

P02M021
Which of the following uses check digit as validity check?
(1) Hong Kong identity card number
(2) ISBN
(3) IP address
A. (1) only
B. (3) only
C. (1) and (2) only
D. (1), (2) and (3)
Answer
C

P02M022
Which of the following methods can be used for data verification?
(1) Enter the data twice by the same person.
(2) Enter the same source data by two persons individually.
(3) Verify the data by check digit.
A. (1) only
B. (3) only
© Pearson Education Asia Limited 2009 6 NSS ICT Compulsory Question Bank
C. (1) and (2) only
D. (1), (2) and (3)
Answer
C

Short Questions

P02S001

Complete the following table regarding data validation.

Validity check Function Example

Ensure all necessary fields


(i) (ii)
are present.

Format check (iii) (iv)

A domestic telephone number in


(v) (vi)
Hong Kong must have 8 digits.
(6 marks)
Answer
(i) Field presence check (1)
(ii) The student number of each student must be included in each student record. (1)
(iii) Ensure the form of data follows some known patterns. (1)
(iv) An e-mail address must be a combination of an account name and a domain name with
the symbol ‘@’ in between. (1)
(v) Field length check (1)
(vi) Ensure the data has the correct number of characters or digits. (1)

P02S002
(a) (i) Describe the use of check digit.
(1 mark)
(ii) In what situation is parity check applied usually?
(1 mark)
(b) Calculate the parity bit of the data:
(i) 11011011 if odd parity check is used;
(1 mark)
(ii) 10001010 if even parity check is used.
(1 mark)
(c) State whether the following data has error(s).

© Pearson Education Asia Limited 2009 7 NSS ICT Compulsory Question Bank
(i) 011010111, if odd parity check is used;
(1 mark)
(ii) 110011000, if even parity check is used.
(1 mark)

Answer
(a) (i) To validate the corresponding data after data entry or transmission (1)
(ii) For binary numbers or signals (1)
(b) (i) 1 (1)
(ii) 1 (1)
(c) (i) Yes, it has one error at least. (1)
(ii) No error is observed. (1)

P02S003

Complete the following table concerning data hierarchy of database. Give examples regarding
the data of a school accordingly.

Level Description Example

(i) A collection of related records (ii)

Field (iii) (iv)

The personal information of


(v) A collection of related fields
a particular student

(vi) A collection of related tables The WebSAMS of a school

Answer
(i) Table (1)
(ii) The personal information of the students in a school (1)
(iii) The smallest unit of data that is meaningful to users (1)
(iv) Address (1)
(v) Record (1)
(vi) Database (1)

P02S004
Index is an important feature of databases.
(a) State the data commonly found in an index.
(2 marks)
(b) Explain how an index helps increase the data searching speed.

© Pearson Education Asia Limited 2009 8 NSS ICT Compulsory Question Bank
(2 marks)
(c) Give two disadvantages of data indexing.
(2 marks)
Answer
(a) An index includes values from one or more fields that are important to certain users (1)
and the associated record numbers arranged in a specific order. (1)
(b) An index is smaller in size than the database table. (1) Moreover, it can be loaded into the
main memory to speed up the searching process. (1)
(c) Indexes take up extra storage space. (1) When there is any data change in a table, extra
time is required to update the corresponding index(es). (1)

P02S005
(a) What is the difference between a database and a database management system?
(2 marks)
(b) A school stores the students’ scores in a table with the following data structure:
class Name course score
(i) Suppose there are 20 classes and 800 students in the school. Each student needs to
study seven courses. How many records are there in the table? Show your steps
briefly.
(ii) There is a design problem in the table structure. State it and suggest one solution for
the problem.
(4 marks)
Answer
(a) A database is a collection of logically linked tables (1) while a database management
system is software used to define, process and manage databases and their applications.
(1)
(b) (i) 800 × 7 = 5,600 (2)
(ii) There is no primary key. (1) Add a field like student ID or HKID number. (1)

P02S006

David wants to create a list of the information of all his customers, which stores their names,
mobile telephone numbers and e-mail addresses.
(a) Suggest the data types for the fields of name and e-mail address respectively.
(2 marks)
(b) Someone proposes that integer should be used as the data type of mobile telephone
number. David disagrees with this. Suggest one appropriate data type for this field and
explain your answer briefly.
(2 marks)

© Pearson Education Asia Limited 2009 9 NSS ICT Compulsory Question Bank
(c) How can you reduce the number of data entry errors of mobile telephone numbers and e-
mail addresses? Suggest one data validation method for them respectively.
(2 marks)
Answer
(a) Character (1)
Character (1)
(b) Character (1)
Allow the use of numbers beginning with ‘0’. (1)
(c) Mobile telephone number: field length check (1)
E-mail address: format check (1)

P02S007

The ‘Student’ table below contains the information of the students in a school.
(a)
Field studentID name contactNo address dateOfBirth
Field length 8 20 8 50 --
W
rite a SQL statement to create the table above.

(2 marks)
(b) Write a SQL statement to insert the following record into the table above:
studentID = 20070313 name = Peter Pan contactNo = 91234567
address = Room 102, ABC Mansion, Tai Man Road dateOfBirth = 13-8-95

(2 marks)
(c) Write a SQL statement to update the record whose ‘studentID’ is ‘20070224’ with the
following information:
ContactNo = 61334567

(2 marks)
Answer
(a) CREATE TABLE Student (studentID CHAR(8), name CHAR(20), contactNo CHAR(8),
address CHAR(50), dateOfBirth DATE) (2)
(b) INSERT INTO Student (studentID, name, contactNo, address, dateOfBirth) VALUES
("20070313", "Peter Pan", "91234567", "Room 102, ABC Mansion, Tai Man Road", "13-
8-95") (2)
(c) UPDATE Student SET contactID = "61334567" WHERE studentID = "20070224" (2)

P02S008
(a) State the data access modes of hard disks and magnetic tapes respectively.

(2 marks)

© Pearson Education Asia Limited 2009 10 NSS ICT Compulsory Question Bank
(b) State one advantage and one disadvantage of using data tapes for backup over hard disks.
(2 marks)
(c) Suggest two storage media that have the same data access mode as hard disks.
(2 marks)
Answer
(a) Hard disk: direct access (1)
Data tape: sequential access (1)
(b) Advantage: The cost per storage unit is lower. (1)
Disadvantage: The access speed is lower. (1)
(c) DVD (1)
USB flash drive (1)

P02S009
Identify the errors and state the types of relevant datavalidation for each of the following.
(6 marks)
(a) Name: Ho San N7n
(b) Age: -13
(c) Date of birth: 25/16/2003
Answer
(a) Name should not contain numbers. (1) Type check should be used. (1)
(b) Age should be a positive number. (1) Range check should be used. (1)
(c) There are only 12 months in a year. (1) Range check should be used. (1)

P02S010
Suggest the most suitable type of data validation for each of the following:
(a) Height
(1 mark)
(b) Test mark
(1 mark)
(c) Temperature
(1 mark)
(d) Sex
(1 mark)
(e) ISBN
(1 mark)
(f) E-mail address
(1 mark)
Answer
(a) Range check (1)
© Pearson Education Asia Limited 2009 11 NSS ICT Compulsory Question Bank
(b) Range check (1)
(c) Range check (1)
(d) Type check (1)
(e) Check digit (1)
(f) Format check (1)

Long Questions

P02L001
Kit has friends who live in Hong Kong and mainland China. He wants to design a database to
store information about his friends. He then designs a database table named ‘Friends’ with the
following structure:
Field Data type Field length Description
firstName Text 20 Given name
lastName Text 20 Surname
homeTel Text 16 Home telephone number
School code of the school which his
schoolID Text 3
friend is studying
email Text 30 E-mail address
hkID Text 10 Hong Kong ID Card number
‘Friends’

(a) Kit increases the field lengths of both ‘firstName’ and ‘lastName’ to 30. Give one
advantage and one disadvantage of this modification.
(2 marks)
(b) Explain why the data type of ‘homeTel’ is text instead of integer.
(1 mark)
(c) (i) Describe one main characteristic of the key field.
(1 mark)
(ii) Explain why ‘hkID’ cannot be used as the key field of the table.
(2 marks)
(d) Write a SQL statement to update home telephone number of his friend Amy Chan. Her
new number is ‘23445367’.
(2 marks)
(e) Kit wants to back up the database. He asks you if DVDs or magnetic tapes should be
used.
(i) State the data access mode of DVDs and magnetic tapes respectively.

© Pearson Education Asia Limited 2009 12 NSS ICT Compulsory Question Bank
(2 marks)
(ii) State your suggestion and explain it briefly.
(2 marks)

Answer
(a) Advantage: Longer names can be stored. (1)
Disadvantage: More storage space is needed. (1)
(b) Numbers beginning with ‘0’ can be stored. (1)
(c) (i) It is unique and can be used to identify a specific record. (1)
(ii) Although each Hong Kong ID Card number is unique, not all Kit’s friends are from
Hong Kong. (1)
So this field is empty for those friends from the mainland China. (1)
(d) UPDATE TABLE Friends
SET homeTel = "23445367" (1)
WHERE firstName = "Amy" AND lastName = "Chan" (1)
(e) (i) DVD: direct access mode (1)
Magnetic tape: sequential access mode (1)
(ii) DVD is a better choice (1) because magnetic tape drives are very expensive. (1)

P02L002
A bookstore uses the ‘Customer’ table to store the information of its customers.
Field name Field type Description
firstName Text First name of the customer
lastName Text Last name of the customer
sex Text Sex of the customer, M or F
phone (i) Contact phone number of the customer
dob (ii) Date of birth of the customer
bookAmt (iii) Number of books that the customer has bought
‘Customer’ table

(a) Fill in the missing field types (i) to (iii).


(3 marks)
(b) It is advised to validate the data during data entry. Suggest one validity check for the
fields ‘phone’, ‘sex’ and ‘bookAmt’ respectively.
(3 marks)
(c) Someone suggests that the field length of either ‘firstName’ or ‘lastName’ field should be
30. Give one advantage and one disadvantage of this suggestion.
(2 marks)

© Pearson Education Asia Limited 2009 13 NSS ICT Compulsory Question Bank
(d) Which field will you add to be the key field? State one reason.
(2 marks)
(e) What is the problem of including the field ‘bookAmt’ in the ‘Customer’ table? Explain
briefly why it is undesirable for the database administrator.
(2 marks)
Answer
(a) (i) Text (1)
(ii) Date (1)
(iii) Integer (1)
(b) ‘phone’: field length check (1)
‘sex’: fixed value check (1)
‘bookAmt’: range check (1)
(c) (i) Advantage: Longer names can be stored. (1)
(ii) Disadvantage: More storage space is needed. (1)
(d) Hong Kong ID card number (1)
It is unique. (1)
(e) The ‘bookAmt’ field needs to be updated whenever a customer has bought a book. (1)
The database administrator has to update this field frequently. (1)

P02L003
A company uses a computer system to store the personal information about all its employees
and their attendance records. The following two tables named ‘Employee’ and ‘Attendance’
are created to store the information.

Field Field name Description


1 empID HK Identity Card number of the employee
2 lastName Last name of the employee
3 firstName First name of the employee
4 dob Date of birth of the employee
5 startYr Start year of the employment
‘Employee’

Field Field name Description


1 absent Number of days absent
2 late Number of days late
‘Attendance’

(a) (i) Someone proposes to define the key field by concatenating the

© Pearson Education Asia Limited 2009 14 NSS ICT Compulsory Question Bank
‘firstName’ and ‘lastname’ fields. Is it feasible? Explain why briefly.
(2 marks)
(ii) Propose one of the above fields to be the key field of the ‘Employee’ table. Explain
your choice briefly.
(2 marks)
(b) Explain why the date of birth rather than the actual age of an employee is stored.
(2 marks)
(c) Suggest one field that must be added to ‘Attendance’ so that the attendance records of an
employee can be retrieved. Explain your suggestion briefly.
(3 marks)
(d) Two digits are used to store the years of employment of employees, e.g. ‘94’ would be
stored in ‘startYr’ for an employee who was employed in 1994. State one advantage and
one disadvantage of this way of storage.
(3 marks)
Answer
(a) (i) No. (1) Since a key field must be unique while people may have the same first name
and last name. (1)
(ii) ‘empID’ (1) since it is unique. (1)
(b) Date of birth does not change for every stored record, (1) while age changes every year.
The database administrator needs to do a lot of work to keep it updated. (1)
(c) ‘empID’ (1)
It is unique (1) and present in the ‘Employee’ table. (1)
(d) (i) Advantage: Less storage space is required. (1)
(ii) Disadvantage: Employees whose ‘startYr’ is ‘09’ may have the actual year of
employment to be 1909, 2009 and so on. (1) It may create undesirable results in
certain processes. (1)

P02L004
Kau Yam School stores the data of its students in a database table named ‘Student’ with the
following data structure:
Field Field name Type Field length Description
1 name Text 50 Student’s name
2 address Text 50 Student’s address
3 dob Date 8 Student’s date of birth
4 sex Text 4 Student’s sex
‘Student’ table

(a) (i) State three sources of errors that may happen during data entry.

© Pearson Education Asia Limited 2009 15 NSS ICT Compulsory Question Bank
(3 marks)
(ii) Suggest one validity check for the ‘name’ and ‘sex’ fields respectively. Explain
your answer briefly.
(4 marks)
(iii) Suggest two data verification methods for the data entry.
(2 marks)
(b) (i) What is the main characteristic of key field?
(1 mark)
(ii) Can we choose ‘name’ as the key field? Explain your answer briefly.
(1 mark)
(iii) Suggest one type of data outside the table that can be used as the key field.
(1 mark)
Answer
(a) (i) Data source error, (1) transcription error (1) and transposition error (1)
(ii) ‘name’: type check (1)
Only letters are allowed. (1)
‘sex’: fixed value check (1)
Only ‘M’ and ‘F’ are allowed. (1)
(iii) Input data twice, (1) double data entry (1)
(b) (i) It is unique that can be used to identify a specific record. (1)
(ii) No, since some students may have the same name. (1)
(iii) ‘student ID’ (1)

P02L005
The following table ‘Student’ stores the information of the students in a school and their test
marks.
Field Description
stuID Student’s identity number
stuName Student’s name
class Class name
classNo Class number
address Student’s address
subjID Subject identity number
testID Test identity number
testMark Mark of test
‘Student’ table

(a) Someone suggests using ‘stuID’ as the key field of the ‘Student’ table. State whether the

© Pearson Education Asia Limited 2009 16 NSS ICT Compulsory Question Bank
suggestion is feasible. If not, suggest another key field.
(5 marks)
(b) Suggest one data validity check for ‘class’ and ‘classNo’ respectively.
(2 marks)
(c) Write a SQL statement that is used to select those records with ‘testMark’ higher than 70.
The results should be ordered by ‘class’ and ‘classNo’ in ascending order.
(3 marks)
(d) The database administrator finds that the table is hard to maintain. Explain the reason
briefly.
(2 marks)
Answer
(a) No. (1) A student may have many subjects and tests (1) and so ‘stuID’ is not unique in
this table. (2)
‘stuID’ + ‘subjID’ + ‘testID’ (2)
(b) (i) ‘class’: field length check (1)
(ii) ‘classNo’: range check (1)
(c) SELECT * FROM Student WHERE testMark > 70 (2)
ORDER BY class, classNo (1)
(d) When a student has more than one test, his information like ‘stuName’, ‘class’, ‘classNo’
and ‘address’ needs to be entered again. (1) This can cause data inconsistency easily. (1)

P02L006
A taxi company stores the information about the daily usage of its taxis in the table ‘T axi’ with
the following structure:
Field name Type Field length Description
taxiID Text 6 Taxi ID
sDate Date 8 Date of service
driverID Text 8 Taxi driver ID
Total fare received by the
fare Numeric 6
driver on that date of service
Number of passengers served
usage Numeric 4 by the driver on that date of
service
‘Taxi’ table

Each taxi may be driven by more than one driver.


(a) Some people think ‘taxiID’ is the key field. Do you think so? Explain your answer
briefly.

© Pearson Education Asia Limited 2009 17 NSS ICT Compulsory Question Bank
(3 marks)
(b) An index is created for the table.
(i) State the function of the index.
(1 mark)
(ii) State two demerits of indexing.
(2 marks)
(iii) What should be the index expression for the table above?
(2 marks)
(c) Write a SQL statement for deleting those records with ‘sDate’ between ‘13-8-06’ and ‘30-
9-07’.
(3 marks)
(d) Which tool in a DBMS can be used to produce the results in a predefined format?
(1 mark)
Answer
(a) No, (1) A taxi may have more than one driver, so it is not unique in this table. (1)
(b) (i) It is used to improve the searching performance. (1)
(ii) Extra storage space is required for the index files. (1)
More time is required to update the records of the tables with indexes. (1)
(iii) ‘taxiID’ + ‘driverID’ (2)
(c) DELETE FROM Taxi (1)
WHERE sDate BETWEEN "13-8-06" AND "30-9-07" (2)
(d) Report (1)

© Pearson Education Asia Limited 2009 18 NSS ICT Compulsory Question Bank

You might also like