Slides Flashcards
Define:
database
A database is a collection of logically related data for a particular domain
Define:
database management system (DBMS)
A DBMS is a software designed for the creation and management of databases.
e.g. Oracle, MySQL
What is the difference between a database and DBMS?
A database is the data stored and a database system is the software that manages the data
What are the three schema/views in the ANSI/SPARC architecture?
Internal/physical, conceptual, external
Define:
Internal view
The physical representation of the database on the computer, that is, how the data is stored
Define:
Conceptual view
The logical structure of the database that describes what data is stored and its relationships.
Define:
External view
The user’s view of the database that provides the part of the database relevant to the user.
What are the benefits of the 3-schema architecture at the external level?
- Each user can access and view data independent of other users.
- Logical data independence, that is, conceptual schema changes do not affect external views
What are the benefits of the 3-schema architecture at the conceptual level?
- A single, shared data representation for all applications and users.
- Users do not have to understand physical data representation details.
- Physical data independence: conceptual schema not affected by physical changes such as adding indexes or distributing data.
What are the benefits of the 3-schema architecture at the internal (physical) level?
Provides standard facilities for interacting with operating system for space allocation and file manipulation
Define:
relation
A relation is a table with columns and rows
Define:
attribute
An attribute is a named column of a relation
Define:
tuple
A tuple is a row of a relation.
Define:
domain
A domain is a set of allowable values for one or more attributes.
Define:
degree
The degree of a relations is the number of attributes (columns) it contains.
Define:
cardinality
The cardinality of a relation is the number of tuples it contains.
Define:
relational database
A relational database is a collection of normalised relations with distinct relation names.
Define:
intension
The intension of a relation is the structure of the relation including its domains.
Define:
extension
The extension of a relation is the set of tuples currently in the relation.
What are keys used for?
Keys are used to uniquely identify a tuple in a relation.
Define:
superkey
A superkey is a set of attributes that uniquely identifies a tuple in a relation.
Define:
key
A key is a minimal set of attributes that uniquely identifies a tuple in a relation.
Define:
candidate key
A candidate key is one of the possible keys of a relation.
Define:
primary key
A primary key is the candidate key designated as the distinguishing key of a relation.
Define:
foreign key
A foreign key is a set of attributes in one relation referring to the primary key of another relation.
True or false: A key is always a superkey.
True.
True or false: A superkey is always a key.
False, as superkeys do not need to have a minimal set of attributes, as long as they uniquely identify a tuple.
What are relational integrity rules for?
Integrity rules are used to ensure the data is accurate.
Define:
constraints
Constraints are rules or restrictions that apply to the database and limit the data values it may store.
Define:
domain constraint
In domain constraints, every value for an attribute must be an element of the attribute’s domain or be null.
Define:
entity integrity constraint
In a base relation, no attribute of a primary key can be null.