Professional Documents
Culture Documents
Practical Recording.
2. Defining UNIQUE.
The UNIQUE constraint ensures that all values in a column are different. Both the
UNIQUE and PRIMARY KEY constraints provide a guarantee for uniqueness for
a column or set of columns.
5. Defining DEFAULT.
The DEFAULT constraint is used to provide a default value for a column. The
default value will be added to all new records IF no other value is specified.
Page 1 of 7
SEU/IS/18/ICT/005
Exercise 01.
The following table named Car from the Database Vehicle shows the information of available
cars. Each car can be uniquely identified by its License Number (PRIMARY KEY). However,
the Engine Serial number is also unique (UNIQUE KEY) to each of the cars.
Page 2 of 7
SEU/IS/18/ICT/005
Exercise 02.
The database named Trip keeps track of business trips of salespersons in a sales office. The
following tables (relations) are available in the database Trip.
SALESPERSON (NIC, Name, Start_year)
Page 3 of 7
SEU/IS/18/ICT/005
Exercise 03.
1. Create a database called Company.
2. Create the following tables as shown below. (Add the necessary keys as suitable)
Page 4 of 7
SEU/IS/18/ICT/005
Page 5 of 7
SEU/IS/18/ICT/005
Page 6 of 7
SEU/IS/18/ICT/005
Page 7 of 7