Page 71 - DCAP508_DATABASE_ADMINISTRATION
P. 71
Unit 5: SQL Server Databases
occurring in a computer in a factory. Assume that events of several types can occur at the same Notes
time, but that no two events occurring at the same time can be of the same type. This can be
enforced in the table by including both the event_type and event_time columns in a two-column
primary key, as shown in the following example.
CREATE TABLE factory_process
(event_type int,
event_time datetime,
event_site char(50),
event_desc char(1024),
CONSTRAINT event_key PRIMARY KEY (event_type, event_time)
Task Differentiate between a column and table constraint with suitable examples.
5.7 Database Diagrams
The Database Designer is a visual tool that allows you to design and visualize a database to
which you are connected. When designing a database, you can use Database Designer to create,
edit, or delete tables, columns, keys, indexes, relationships, and constraints. To visualize a
database, you can create one or more diagrams illustrating some or all of the tables, columns,
keys, and relationships in it.
Figure 5.1
LOVELY PROFESSIONAL UNIVERSITY 65