Relational Databases

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

16 Terms

1
New cards

What is a Relation?

set of rows/tuples with a description

made up of two parts - instance and relationship schema

2
New cards

What is an Instance?

table with rows and columns

#rows = cardinality, #fields/attributes = degree/arity

3
New cards

What is a Relationship Schema (RS)?

specifies the relations name and type (domain) of each column

4
New cards

What is an example of the format of a RS?

Student(sid: INT, name: TEXT, login: TEXT, age: INT, gpa: DOUBLE)

lowercase - name

capital - type/domain

5
New cards

What is an Integrity Constraint (IC)?

condition that must be true for any database instance

6
New cards

What is a Legal Instance of a Relation?

satisfies all specified ICs

7
New cards

What is a Domain Constriant?

in any database instance, a value of the attribute must be an element of the attribute’s domain as set in the RS

8
New cards

What is an Entity Integrity Constraint?

a key value can’t be duplicated or left empty in any instance

9
New cards

What is Integrity of Data?

the state of data in which data obeys the constraints set by the DBA

10
New cards

When is Referential Integrity achieved?

if all foreign key constraints are enforced

11
New cards

What is a Foreign Key?

a logical pointer

peripheral attribute that establishes referential integrity between entity sets

12
New cards

How do you create a Foreign Key?

either:

  • import the primary key from one table to the other or,

  • create a new table that holds the primary keys of the tables in relation

13
New cards

What are Foreign Key Requirements?

  • must have the same name and domain as the referencing relation

  • related entries must have the same values

14
New cards

What does NO ACTION do?

delete/update is rejected

default

15
New cards

What does CASCADE do?

also deletes all tuples that refer to deleted tuple

16
New cards

What does SET NULL/ SET DEFAULT do?

sets foreign key value of referencing tuple