Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

UNIVERSITY OF MANAGEMENT AND TECHNOLOGY

Spring 2020
Database Systems SE370/CS370/CC2141/CC2421W/XI533
(4 Credits Hours)

DATABASE

Name: TAYYABA ABID


ID: 18002105-001
Batch# 02
Dept. : BS-IT

Assignment: 1
UNIVERSITY OF MANAGEMENT AND TECHNOLOGY
Spring 2020
Database Systems SE370/CS370/CC2141/CC2421W/XI533
(4 Credits Hours)

Q1. In the lecture, we have seen the following ways to ensure consistency in a
database: NOTNULL , UNIQUE, PRIMARYKEY , FOREIGNKEY ,
CHECK, and DEFAULT. Fill in the following grid answering which of these
applies to which use case. Mark cases that apply with an “Tick symbol”.
Explain why.
Consistency Keyword
NOT PRIMARY FOREIGN DEFAULT
UNIQUE CHECK
NULL KEY KEY
Ensure referential consis- 
tency between relations.
Enforce that each row has
  
some attribute.
Limit the domain of values
that can be stored in an    
attribute.
Enforce a constraint based
on the content of a differ- 
ent table.
Enforce a constraint based 
on two different attributes.
Uniquely identify records.  

Q2. Are the following statements true or false? Place a checkmark in the
correct ones.
 In principle a CHECK constraint could be added to a table that makes it
impossible to insert any data. ( TRUE )

 A PRIMARYKEY attribute can have up to one NULL value.( FALSE )


 The PRIMARYKEY constraint can be augmented with an
ONDELETESETNULL ( FALSE )
.
 The ONDELETECASCADE constraint specified for an attribute in a table
leads to record deletions in the referenced tables.( FALSE )
UNIVERSITY OF MANAGEMENT AND TECHNOLOGY
Spring 2020
Database Systems SE370/CS370/CC2141/CC2421W/XI533
(4 Credits Hours)

 The CHECK constraint cannot alter values in a table. ( TRUE )

You might also like