Relational Database Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a database?

A

A well-organised collection of data
that are related in a meaningful way,
describing a domain of interest
(a collection of relations)

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

What is a relational database?

A

Focus on things in the
domain of interest and the relations between
them

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

What is a database management system?

A

Software that helps
maintain and utilise large collections of data in an
efficient manner

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

What are the advantages of a database management system?

A

Data independence
 Efficient data access
 Data integrity
 Concurrent access and recovery from crashes

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

What does a relation consist of?

A

Relation schema: describes the format of a table,
consisting of:
• Relation’s name
• Name of each field (column)
• Domain of each field
 Relation instance: the content of a table
• A set of tuples (records)

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

What is Arity?

A

Also called degree

Number of fields

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

What is Cardinality?

A

Number of rows

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

What is Structured Query Language?

A

Standard language
for creating, manipulating and querying data in
relational database management systems

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

What is Data Definition Language?

A

Subset of SQL that

allows us to create, delete and modify tables

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

How do you create relations with DDL?

A

CREATE TABLE declaration: define a new relation
(called ‘table’ in SQL) with a particular schema
CREATE TABLE table-name (
⟨attribute declarations⟩
⟨integrity constraints⟩
)

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

What is Domain constraint?

A

For each row in this table, the
values in each column must be drawn from the
appropriate domain
-Condition of the database

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

What are the integrity constraints?

A
  • Key constraints

- Foreign key constraints

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

What is the Primary key?

A

-Uniquely identifies a tuple
-No 2 rows in the table have the same mn
PRIMARY KEY (mn)

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

What is the Foreign key?

A

Specify links between tables
Will always take a value that appears in the table you choose
FOREIGN KEY (mn) REFERNECES Course
The foreign key in a referencing relation must match
the primary key of the reference relation.
• Same number of columns and same domains.

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

What should happen if a row in the table is deleted?

A
  1. All rows in Takes that refer to it should be deleted (ON DELETE CASCADE)
  2. For each row in Takes that refer to it, set its mn value to some pre-specified default value (ON DELETE SET DEFAULT)
  3. For each row in Takes that refer to it, set its mn value to null (ON DELETE SET NULL)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly