Midterm Vocabulary Flashcards

(59 cards)

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
different NULL contextes
1. missing value 2. inapplicable
26
entity
an object distinguishable from another object
27
entity set
a collection of similar entities
28
functional dependencies
a form of constraint
29
Armstrong Axiom 1
reflexivity every trivial FD is true ex. A,B -> A,B
30
Armstrong Axiom 2
augmentative adding attributes in dependencies does not change the basic dependencies ex. A->B implies A,C->B,C
31
Armstrong Axiom 3
transitivity ex. If A->B and B->C, then A->C
32
attribute closure
If X is an attribute set, the closure X+ is the set of all attributes B s.t X->B
33
superkey
a set of attributes that determines another attribute in a relation
34
key
a minimal superkey
35
decomposition
taking a relation and creating subrelations
36
what should a good decomposition achieve?
1. minimize redundancy 2. avoid information loss (lossless-join) 3. preserve the FDs (dependency reserving) 4. ensure good query performance
37
how do you check for lossless join decomposition?
chase algorithm
38
dependency preserving
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
Boyce Codd Normal Form (BCNF)
a relation is in BCNF when if X is a superkey in R, R is in BCNF
40
is normalization always good?
no, might produce unacceptable performance loss
41
relational query language
allow the manipulation and retrieval of data from a database
42
what are the two types of query languages?
declarative and procedural
43
declarative language
describe what a user wants, rather than now to compute it
44
procedural language
operational, useful for representing execution plans (relation algebra)
45
relational algebra
an algebra whose operands are relations or variables that represent relations
46
what operations are symmetric?
union, cross product, intersection, theta join, equi join, natural join
47
theta join
cross product followed by a selection
48
equi join
selection only contains equalities
49
natural join
equi join on all common fields (attributes with same name)
50
semi join
natural join followed by projection on the attributes of R1
51
selection
selection for certain condition
52
projection
gets distinct chosen attributes
53
one to one
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
one to many
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
many to many
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
weak entity
an entity set that can only be identified uniquely by considering some of its attributes with the primary key of another entity
57
restrictions on weak entity sets
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
what are the three approached to create entity set subclasses
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
what is a view in sql?
allows you to create a virtual table based on an SQL query referring to other tables in the database