Midterm Vocabulary Flashcards

1
Q

What is a database?

A

an organized collection of structured data

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

what is a database management system?

A

a program that allows us to manage efficiently a large DB and allows data to persist over long periods of time

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

data model

A

abstraction that describes the data

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

schema

A

describes a specific database using the language of the data model

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

query language

A

high level language to allow a user to store and retrieve data from the DB

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

relation

A

a table

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

domain

A

what values are allowed (each attribute has an atomic type)

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

instance of a relation

A

a set of tuples or records

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

instance of a database

A

a collection of relation instances

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

what is the difference between a schema and an instance?

A

schema is the type, stable over long periods (static)
instance is the value, changes constantly

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

SQL

A

structured query language, used to query and manipulate data
it is a declarative language

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

primary key

A

a minimal subset of attributes that is a unique identifier of tuples in a relation

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

unique key

A

a subset of attributes that uniquely define a row

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

what can we use in where clauses?

A

attribute names, comparison operators, arithmetic operations, AND OR NOT, operations on strings, pattern matching, special functions for comparing dates and time

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

foreign key

A

similar to a pointer that directs to information in another table

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

how are referenced attributes declared?

A

must be declared as primary key or unique

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

what are the two violations between foreign key constraints (let R and S be relations where attributes of S are the primary key of R)?

A
  1. an insert or update to R introduces values not found in S
  2. a deletion or update to S causes some tuples of R to dangle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what are the 3 ways to enforce foreign key constaints?

A

reject, cascade update/delete, set NULL

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

reject

A

insert/delete/update is rejected

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

cascade update

A

update propagates to the tuples that reference it

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

cascade delete

A

the deletion propagates to the tuples that reference it

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

set NULL

A

when a delete/update occurs, the values that reference the deleted tuple are set to NULL

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

uncorrelated subquery

A

the inner query doesn’t depend upon outer query for its execution (can complete execution on its own)

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

correlated subquery

A

inner query depends upon the outcome of the outer query in order to perform its executions

25
Q

different NULL contextes

A
  1. missing value
  2. inapplicable
26
Q

entity

A

an object distinguishable from another object

27
Q

entity set

A

a collection of similar entities

28
Q

functional dependencies

A

a form of constraint

29
Q

Armstrong Axiom 1

A

reflexivity
every trivial FD is true
ex. A,B -> A,B

30
Q

Armstrong Axiom 2

A

augmentative
adding attributes in dependencies does not change the basic dependencies
ex. A->B implies A,C->B,C

31
Q

Armstrong Axiom 3

A

transitivity
ex. If A->B and B->C, then A->C

32
Q

attribute closure

A

If X is an attribute set, the closure X+ is the set of all attributes B s.t X->B

33
Q

superkey

A

a set of attributes that determines another attribute in a relation

34
Q

key

A

a minimal superkey

35
Q

decomposition

A

taking a relation and creating subrelations

36
Q

what should a good decomposition achieve?

A
  1. minimize redundancy
  2. avoid information loss (lossless-join)
  3. preserve the FDs (dependency reserving)
  4. ensure good query performance
37
Q

how do you check for lossless join decomposition?

A

chase algorithm

38
Q

dependency preserving

A

a decomposition is dependency preserving if by enforcing F1 over R1 and F2 over R2, we can enforce F over R where F = F1 and F2

39
Q

Boyce Codd Normal Form (BCNF)

A

a relation is in BCNF when if X is a superkey in R, R is in BCNF

40
Q

is normalization always good?

A

no, might produce unacceptable performance loss

41
Q

relational query language

A

allow the manipulation and retrieval of data from a database

42
Q

what are the two types of query languages?

A

declarative and procedural

43
Q

declarative language

A

describe what a user wants, rather than now to compute it

44
Q

procedural language

A

operational, useful for representing execution plans (relation algebra)

45
Q

relational algebra

A

an algebra whose operands are relations or variables that represent relations

46
Q

what operations are symmetric?

A

union, cross product, intersection, theta join, equi join, natural join

47
Q

theta join

A

cross product followed by a selection

48
Q

equi join

A

selection only contains equalities

49
Q

natural join

A

equi join on all common fields (attributes with same name)

50
Q

semi join

A

natural join followed by projection on the attributes of R1

51
Q

selection

A

selection for certain condition

52
Q

projection

A

gets distinct chosen attributes

53
Q

one to one

A

a record in one entity is associated with exactly one record in another entity
ex. each capital only has one country, and each country only has one capital

54
Q

one to many

A

a record in one entity is associated with more than one record in another entity, but not the other way around
ex. each mother has more than one child, but each child only has one mother

55
Q

many to many

A

a record in one entity is associated with more than one record in another entity and vice versa
ex. each author has more than one book and each book can have more than one author

56
Q

weak entity

A

an entity set that can only be identified uniquely by considering some of its attributes with the primary key of another entity

57
Q

restrictions on weak entity sets

A

the owner entity set, and the weak entity set must have a one-to-many relationship (an owner is associated with one or more weak entities, but each weak entity has a single owner)

58
Q

what are the three approached to create entity set subclasses

A
  1. create a relation for each class with all its attributes
  2. create one relation for each subclass with only the key attribute(s) and attributes attached to it
  3. create one relation; entities have null in attributes that do not belong to them
59
Q

what is a view in sql?

A

allows you to create a virtual table based on an SQL query referring to other tables in the database