database midterm Flashcards
(39 cards)
purpose of a database
to store data
instance in a database
is a single occurrence within that table eg. a row in the student table
attribute
is each column in the table
microsoft access is a what?
Good database for beginners but not for professionals
what is the dominant database model
relational database model
SQL
structured query language was developed by IBM in the 70’s. Not a full program language it is a sublanguage.
2 categories of SQL
data definition language and data manipulation language.
Data definition language:
statemns used for creating tables, relationships and other structures
Data manipulaion language
statements used for reading writing deleting and updating records
SQL select statement
select columnName
from: TableName
Where: conditions
How do you select all columns in table
asterisk in the select part
Entity
is some identifiable thing that users want to track: Students, factulty, courses, schools
functional dependency
ocurs when the value of one attribute determines the value of a second attribute
EX: StudentId is a determinant of name
composite determinant
a determinant of a functional dependency that consists of more than one attribute
Unique determinant:
is only when it determines every other column in the relation.
Candidate key:
is a key that determines all of the other columns in a relation. from the candidate keys one will be the primary key.
primary key
is a candidate key that is selected to uniquely identify a row in a relation. must be unique
Surrogate Key
is an artificial column added to a relation to serve as a primary key. this is done with a good PK cannot be found.
foreign key
is the primary key of one relation that is placed in another relation to form a link between the relations. the foreign key of one table must be a PK in another table
Referential integrity constraint
limts the foreign key to be a PK in another table
multi-valued dependency
occurs when a determinant is matched with a particular set of values
how do you count the number of rows in a table
COUNT (*)
when does it not matter if they database is in BCNF or not
if it is a updateable database or not
how do you copy info to another table?
use the command insert into tableName