TOPIC 2 - Databases Flashcards

1
Q

what are the 2 ways to store data digitally?

A
flat files (one large table)
relational database (many smaller tables)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

benefits of a flat file

A

simple to create
easy to understand
all data in one place
good for one person with small amount of data

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

key question of flat files

A

how are the needs of storing data for one person diff from needs of storing data for a large company

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

goal of flat files

A

accurate, timely, relevant information

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

limitations of flat files

A
lack of security
lack of multiple access
lack of data integrity
lack of scalability
program data dependance
lack of custom formats (view)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a database?

A

a collection of related information stored in a structured form

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

what does schema describe

A

structure of a database

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

what is a database management system

A

a collection of programs that manipulate a database: updates, queries, etc

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

why use databases and dbms?

A

Data integrity -> reduce redundancy and inconsistency
Data independence from the program
Security
Enable data sharing and high availability
Provide centralized data administration
Reduce application development time because standard software packages exist in the market for these tasks

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

name the 4 common types of databases

A

hierarchy, network, relational, object oriented

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

explain a hierarchy model

A

model data as a tree

Captures relationship among the data (parent can have many children)

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

explain a network model

A

model data as a network
A child can have multiple parents
Faster than relational
Not as common

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

explain object oriented model

A

model data as objects
Stores both the type of data and procedures that manipulate the data
Becoming more popular

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

explain inheritance vs polymorphism

A

Inheritance is when an instance of a sub-class receives the same properties of its super-class

Polymorphism is when a sub-class implements a method which can override the one defined in the super-class

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

explain relational model

A

modelled as a table and information is related

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

what is an attribute/field

A

single value of a column (headers)

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

what is a domain?

A

set of allowed values for an attribute

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

what are entities?

A

a table stores information about entities (rows in a table)

people, places, things, or events

19
Q

what is a record/tuple

A

a collection of attribute values for an entitity

20
Q

what is a primary key

A

A minimum set of attributes whose values are unique in each row of a table

21
Q

what is a composite key?

A

when it takes 2 or more attributes to uniquely identify a row

22
Q

what are candidate keys?

A

when there is more than one key that can be used as a primary key and one is designated as the primary key

23
Q

what is a foreign key?

A

An attribute in a table that is also a primary key in another table and is used to link different tables together

24
Q

what do you do if your database is growing so large that you need to split it over multiple hard drives?

A

Separated how the data is stored (physical schema from how the data is used (exetrnal schema)

25
Q

what do you do if different users are interested in different parts of the database?

A

Create a single global view of the data (conceptual schema) that feeds into many individual views of the data (external schema) for the different user groups

26
Q

what are the 3 schema architecture?

A

external, conceptual, physical

27
Q

explain external schema

A

How the data is displayed to a particular user
Different views for different user groups
The rest of the database is hidden from that user

28
Q

explain conceptual schema

A

A global description of the whole database

Unbiased towards any particular group of users

29
Q

explain physical schema

A

How the data is physically stored and organized

What data is in which file on which disk

30
Q

why have 3 layers or schema?

A

data independence: separation of storage, organization and presentation

31
Q

what is the motivation of 3 layers for schema?

A

change the data format without changing the software

32
Q

what is SQL?

A

structured query language

Most commonly used language to create, manage, and query a database

33
Q

list the main operations of SQL

A

select, join, project

34
Q

explain data manipulation and definition

A

manipulation: the contents of a database can be accessed using a data manipulation langage which specifies the contents to extract
definition: database contents must be clearly defined using a data defn language which specifies the type of each attribute/field/column heading

35
Q

what are the limitations of relational databases

A

multimedia data
arrays of data
unstructured text
hierarchical data

36
Q

what are the criteria for a good database design

A

Correctness: info is accurate
Completeness: it characterizes all the data
Minimum redundancy: unfortunately this cannot be completely elimninated in all cases

37
Q

what are the 3 steps in database design for relational databases

A
  1. Identify the entities to store and the relationships between these entities
  2. Convert the ER diagram into tables
  3. Fine tune your design
38
Q

what are the 3 cardinalities of relationships? Where do you put the primary key?

A

1: 1 relationships: place the primary key from one entity and any attributes of that relationship into the other entity’s table
1: N relationships: place the primary key from the “1” side of the relationship to the “N” entity’s table

N:M relationships: create a new table with composite key (primary keys from both entities) and include associated data

39
Q

how are relationships represented in a tablle?

A

foreign keys in one entity’s table

get their own table

40
Q

main purpose of normalization process?

A

minimize redundancy

41
Q

explain Boyce-Codd Normal Form

A

every attribute for an entity depends only on the candidate key(s)

42
Q

explain functional dependency A -> (B,C)

A

The value of A determines the values of B and C

Knowing the value of A, there is only one possible value for B and C in the database

43
Q

Abilities of a relational database

A
Record data
Search for an item
Select and project
Join
Summarize
44
Q

Limitations of a relational database

A

Statistical analysis: what if, forecasting, correlation

Discover relationships, patterns, trends