Prelims Flashcards

1
Q

Enumeration

The purpose of a database

A

To store data
To provide an organizational structure for data
To provide a mechanism for querying, creating, modifying, and deleting data

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

Enumeration

Main problems with list

A
  1. Redundancy (the same information may be entered several times)
  2. Multiple themes (each row may contain more than one business concept)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Enumeration

Redundancy and Multiple themes create modification problems:

A

Deletion problems
Update problems
Insertion problems

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

Identification

is an international standard language for creating, processing and querying databases and their tables

A

Structured Query Language (SQL)

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

Identification

This ensures that the values of a column in one table are valid based on the values in another table

A

Referential Integrity constraints

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

Identification

is one or more columns of a relation whose values are used to identify a row

A

Key

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

Identification

Composed of two or more attributes

A

Composite Key

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

Identification

It has the potential to become the primary key

A

Candidate key

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

Identification

A candidate key chosen to be the main for the relation

A

Primary key

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

Identification

A unique, numeric value, that is added to a relation to serve as the primary key

A

Surrogate key

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

Identification

A primary key from one table that is placed into another table

A

Foreign key

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

Identification

states that every value of a foreign key must match the value of an existing primary key

A

Referential integrity

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

Identification

A relationship between attributes in which one attribute (or a group of attributes) determines the value of another attribute in the same table

A

Functional Dependency

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

Identification

The attribute (or attributes) that we use as the starting point (the varibale on the left side of the equation) is called a

A

Determinant

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

Identification

  • A process of analyzing a relation to ensure that it is well-formed
  • Involves decomposing relations with anomalies to produce smaller, well-structured relations
  • When we apply this to a relation, rows can be inserted, deleted, or modified without creating anomalies
A

Normalization

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

Define

1NF

A

Remove multivalued attributes

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

Define

2NF

A

Remove partial dependencies

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

Define

3NF

A

Remove transitive dependencies

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

Identification

Candidate key
Composite key
Primary key
Surrogate key

A

Unique keys

Dan’s Topology of Db keys

20
Q

Foreign key

A

Non-unique

21
Q

Enumeration

Unique keys

A

Candidate key
Composite key
Primary key
Surrogate key

22
Q

Non-unique key

A

Foreign key

23
Q

Enumeration

SQL is comprised of

A

DDL
DML
DCL

24
Q

Enumeration

DDL
DML
DCL

A

Data Definition Language
Data Manipulation Language
Data Control Language

25
Q

Identification

Used to define and manage data structures

A

Data Definition Language

26
Q

Identification

  • Data definition and updating
  • Data retrieval
A

Data Manipulation Language

27
Q

Identification

For creating user accounts, managing permissions etc.

A

Data Control Language

28
Q

Identification

used to specify that when a row is deleted from the parent table, all rows in the child table that reference the deleted row should also be deleted

A

ON DELETE CASCADE

29
Q

Identification

used to specify that when a row is updated from the parent table, all rows in the child table that reference the updated row should also be updated

A

ON UPDATE CASCADE

30
Q

Which normalization phase is being described?

every non-key attribute is fully functionally dependent on the entire primary key not just part of it

A

2NF

31
Q

Which normalization phase is being described?

Every value is atomic

A

1NF

32
Q

Which normalization phase is being described?

no transitive dependencies

transitive dependencies = functional dependencies on non-primary-key attributes

A

3NF

33
Q

Identification

is a type of dependency that occurs when a non-key attribute depends on another non-key attribute

A

Transitive Dependency

34
Q

Identification

a type of dependency that occurs when a non-key attribute depends on only one part of a composite primary key

A

Partial Dependency

35
Q

Identification

  • are used to specify rules for the data in a table
  • are used to limit the type of data that can go into a table
A

Constraints

36
Q

Identification

this constraint specifies that the constrained columns’ values must uniquely identify each row

A

Primary Key (Pk) constraint

37
Q

Identification

this constraint ensures that only valid data can be inserted into the related column, as the value must exist in the referenced table

A

Foreign Key (Fk) constraint

38
Q

Sql Syntax

Creating Table with PK constraints

A
CREATE TABLE Employee (
empID Integer NOT NULL,
empName Char(25) NOT NULL,
CONSTRAINT PRIMARY KEY (empID)
);
39
Q

Sql Syntax

Creating Table with PK and FK constraints

A

CREATE TABLE EmployeeSkill (
empID Integer NOT NULL,
skillId Integer NOT NULL,
skilllevel Integer NULL,
CONSTRAINT PRIMARY KEY (empId, skillId),
CONSTRAINT FOREIGN KEY (empID) REFERENCES employee(empID),
CONSTRAINT FOREIGN KEY (skillId) REFERENCES Skill (skillid)
);

40
Q

Sql Syntax

Create Table with update and delete cascades

A

CREATE TABLE Employeeskill (
empID integer NOT NULL,
skillId integer NOT NULL,
skilllevel integer NULL,
CONSTRAINT PRIMARY KEY (empId, skillId),
CONSTRAINT FOREIGN KEY (empId) REFERENCES employee (empId)
ON DELETE CASCADE,
CONSTRAINT FOREIGN KEY (skillId) REFERENCES Skill (skillId)
ON UPDATE CASCADE
);

41
Q

Identification

the same information may entered several times

A

Redundancy

42
Q

Identification

each row may contain more than one business concept

A

Multiple themes

43
Q

Identification

stores information in tables

Each business concept is stored in its own table

A

Relational Database

44
Q

Uniqueness of keys

Data value is unique for each row
Consequently, the key will uniquely identify a row

A

Unique Key

45
Q

Uniqueness of keys

Data value may be shared among several rows
Consequently, they key will identify a set of rows

A

Non-unique key

46
Q

Identification

adds, deletes, modifies, renames the attributes of the relation

A

ALTER

47
Q

Identification

modifies the values of the records in the relations

A

UPDATE