SQL Contraints and Triggers Flashcards

1
Q

What does the keyword UNIQUE do?

A

Declares keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What do the keywords NOT NULL do?

A

Disallows null values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do the keywords PRIMARY KEY do?

A

It is a combination of key + not null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do the keywords FOREIGN KEY do?

A

References attributes in other tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

_____ values are ignored when checking constraints

A

NULL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

_____ uniquely identify the tuples of a relation

A

KEYS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you declare a key with more than one attribute?

A

UNIQUE (p1, p2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are 3 ways to handle a deletion of an property referred to by a foreign key?

A
  1. Reject
  2. Propogate
  3. Set to NULL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A _______ rejects updates/insertions of the condition is false

A

CHECK

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A _______ is a datatype with optional constraints

A

DOMAIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

An _______ is a CHECK constraint not bound to a specific table

A

ASSERT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are 3 components of a trigger?

A
  • Event (update, delete, etc)
  • Condition
  • Action (make queries, examine)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

TRIGGERS are processed in a _______ order

A

arbitrary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A collection of TRIGGERS can have ______________ effects

A

unpredictable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly