Professional Documents
Culture Documents
Tables
ICT Focus
Creating a database
Creating a database table
Setting constraints on a database table
Creating an index for a database table
Inserting data into a database table
Changing the structure of a database table
Removing a database
Removing a database table
Setting the access rights of database users
SQL is only for carrying out database operations while general-purpose computer
languages are for building applications.
Activity 3
CREATE TABLE Equipment
(equipID CHAR(5) NOT NULL UNIQUE, equipName CHAR(30) NOT
NULL, equipPrice INTEGER);
Activity 4
(a) ‘fileName’, ‘releaseYear’ and ‘directorName’. In the same year, a director
usually does not produce two films of the same name.
Activity 5
1. CREATE DATABASE Business;
© Pearson Education Asia Limited 2010 1 NSS ICT Elective A1 Textbook Answers
2. CREATE TABLE Salesman (salesID CHAR(6) PRIMARY KEY,
salesName CHAR(20));
Concept Map
1. B
2. A
3. C
4. D
Concept Checker
1. T
2. T
3. T
4. F
5. F
6. T
7. F
8. T
© Pearson Education Asia Limited 2010 2 NSS ICT Elective A1 Textbook Answers
Short Questions
1. Functions of a DDL:
Create database objects.
Define the structures of the database objects and the integrity constraints of
the database.
Modify the structures of the database objects.
Remove the database objects.
(any three × 1)
Functions of a DML:
Insert new records.
Modify existing records.
Delete existing records.
Retrieve data from the database.
(any three × 1)
2. Table name / field names / data types of the fields / ‘NOT NULL’ constraint /
‘Default’ constraint / ‘Unique’ constraint / primary key / foreign key
(any five × 1)
(b) The field names of the table in sequence (1) and the data types of the fields
(1)
Long Questions
1. (a) CREATE TABLE Book
(bookID INTEGER PRIMARY KEY, title CHAR(40), price
DECIMAL(5, 1)); (2)
© Pearson Education Asia Limited 2010 4 NSS ICT Elective A1 Textbook Answers