Compsci Is For Nerds Flashcards

(42 cards)

1
Q

Database

A

Collection of interrelated persistent data stores without unnecessary redundancies to serve one or more applications

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

DBMS

A

Database Management System enables users to create maintain and control access

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

DBMS Disadvantage

A

Complexity, cost of management, performance, converting old data

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

Rows and columns

A

Rows called records column given distinct nane

Must be unique to prevent redundancies

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

Field

A

Attribute within a record carrying data, makes primary key

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

Entity

A

A table, attributes are shown as column headings
Must have primary key
Things that can only have one instance cannot be entities

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

Candidate Key

A

Minimal number of attributes uniquely identifting occurence of an entity
Primary key is chosen candidate key to identify records

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

Attribute lore

A

If max amount of values is known it can be an attribute, if an attribute has its own attribute it should be a seperate entity referenced by ID

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

Weak entity vs Strong entity

A

Weak entity is a child as one box and strong entity is a parent as box with outline

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

1NF Check

A

A table must not have more than one entry in any field

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

1NF Fix

A

Duplicate the rest of the row in the offending field

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

Non 1NF problems

A

Slow search
Inserting deleting updating difficult and error prone
Wasted space

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

Key Field (Candidate Key)

A

Different for every row so can be used to identify each row

Fields may need to be combined to form a key

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

Dependent key

A

If we know the value of a record from other records it is dependent

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

B is dependent on A

A

A: Determinant
B: Dependent
Non key fields are dependent on key fields

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

2NF Check

A

Check in 1NF

All non key fields must depend on whole table key

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

2NF Fix

A

Two or more tables created to replace original table

18
Q

Non 2NF Problems

A

Information is duplicated
Null values may be required
Insertion, updating, deletion problematic

19
Q

3NF Check

A

Check in 2NF
All non key fields dependent on only the key
No transitive dependency

20
Q

3NF Fix

A

Two or more tables must be created to replace original table

21
Q

3NF Inconsistency

A

If more than one possible candidate key, which is composite and the keys share a common field

22
Q

BCNF Check

A

Check in 3NF

Check all determinants in a relation must be candidate keys

23
Q

BCNF Fix

A

The fields that depend on the field which is not a candidate key must be removed and put into a new table with their determinants as key

24
Q

What do fourth and fifth normal forms deal with

A

3 or more key fields and no dependent fields

25
4NF Check
Check in BCNF | No independent multi-value dependencies
26
4NF Fix
Split the table so there is no more than one MVD in each of the new tables 3 way multi dependency into 2 two way dependencies
27
5NF Check
Check in BCNF | Check table without any related multi-valued dependencies
28
Related Multi Value Dependencies
MVD not totally independent of each other | Not all possible combinations occur in the data
29
5NF Fix
Split table into 3 tables so that there is no more than one MVD in each of the new tables 3 way multiple dependency broken down to 3 2 way dependencies
30
DBMS Needs
DDL - Data Definition Language | DML - Data Manipulation Language
31
DDL
User can create new objects with create alter and drop statements
32
DDL Syntax
Create Table table-name (column-details) Drop Table table-name Alter Table table-name command column-details
33
Column details
Record name with data type | E.g ID_Num INTEGER,...
34
Column types
Char, Varchar, Integer, Numeric, Boolean, Date
35
Type info
Char is fixed while varchar is variable | Numeric(n,m) where n and m are digits after decimal
36
Data Manipulation Language
User can retrieve, insert, delete and update data in a database
37
DML Insert
Insert Into table-name (columns) Values (value-list) Can name columns where any unmentioned columns are set to null Can copy data using select
38
DML Update
Update table-name Set column-assignments Where conditions
39
Column assisgnments
List of assignments separated by commas of form: | column-name = new-value
40
DML Delete
Delete From table-name | Where conditions
41
View Syntax
Create View view-name As Select (x) from emp/dept etc. Can make view based on another view
42
Why create a view
Restrict access Save complex expressions Sort/group information Make Logical Data Independence