Midterm Vocabulary Flashcards
What is a database?
an organized collection of structured data
what is a database management system?
a program that allows us to manage efficiently a large DB and allows data to persist over long periods of time
data model
abstraction that describes the data
schema
describes a specific database using the language of the data model
query language
high level language to allow a user to store and retrieve data from the DB
relation
a table
domain
what values are allowed (each attribute has an atomic type)
instance of a relation
a set of tuples or records
instance of a database
a collection of relation instances
what is the difference between a schema and an instance?
schema is the type, stable over long periods (static)
instance is the value, changes constantly
SQL
structured query language, used to query and manipulate data
it is a declarative language
primary key
a minimal subset of attributes that is a unique identifier of tuples in a relation
unique key
a subset of attributes that uniquely define a row
what can we use in where clauses?
attribute names, comparison operators, arithmetic operations, AND OR NOT, operations on strings, pattern matching, special functions for comparing dates and time
foreign key
similar to a pointer that directs to information in another table
how are referenced attributes declared?
must be declared as primary key or unique
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)?
- an insert or update to R introduces values not found in S
- a deletion or update to S causes some tuples of R to dangle
what are the 3 ways to enforce foreign key constaints?
reject, cascade update/delete, set NULL
reject
insert/delete/update is rejected
cascade update
update propagates to the tuples that reference it
cascade delete
the deletion propagates to the tuples that reference it
set NULL
when a delete/update occurs, the values that reference the deleted tuple are set to NULL
uncorrelated subquery
the inner query doesn’t depend upon outer query for its execution (can complete execution on its own)