Flashcards
Databases Topic 1
Flashcards do conjunto (35)
- 1What is a database?A collection of information that is organized so that it can easily be accessed, managed, and updated.
- 2What is Data Redundancy?Refers to unnecessary duplication of data
- 3Examples of problems when data redundancy is present- Wasteful storage
- Results in a loss of integrity - 4What is a Relational Model?A data model will have three features:
Data Structure
Operators
Constraints - 5What are keys?An attribute or set of attributes is called a key.
- 6Super KeyA superkey is an attribute or combination of attributes containing unique values for each tuple.
- 7Eg. Student (StudentNo, FamilyName, Degree, Major, GPA) List the Super Keys.Superkeys {SK}:
{StudentNo}
{StudentNo, FamilyName}
{StudentNo, Degree, Major} - 8Candidate KeyA minimal superkey
- 9Eg. Motor Vehicle (EngNum, RegNum, Color, Model) List the Candidate keys.Super key {SK}:
{EngNum, RegNum}
{EngNum, Color, Model}
Candidate key {CK}: minimal superkey
{EngNum}
{RegNum} - 10Primary keyThe value of the primary key:
MUST be UNIQUE
MUST NOT be NULL
If a primary key is made up of > 1 attribute, it is known as a compound, composite or concatenated primary key. - 11Eg. Motor Vehicle (EngNum, RegNum, Color, Model) List the Primary key.Primary key {PK}: UNIQUE & NOT NULL;
also a candidate key
{RegNum} - 12Alternate KeyAn alternate key is simply, any candidate key that is not chosen as the primary key of the relation.
- 13Eg. Motor Vehicle (EngNum, RegNum, Color, Model) List the Alternate Key.Candidate key {CK}: minimal superkey
{EngNum}
{RegNum} <- {Chosen PK}
Alternate Key {AK}: candidate key that is not chosen as primary key.
{EngNum} - 14Foreign KeyA foreign key is an attribute in one relation that is used to reference the primary key in another relation.
- 15Secondary KeyA secondary key is an attribute or set of attributes that are used for data retrieval purposes/
- 16Data Integrity ConstraintsData integrity means that the data held in the database must make sense.
- 17Domain ConstraintsDomain constraints specify: The value of each attribute must be an atomic value from a specific domain.
- 18Example of Domain ConstraintsDomains can be standard data types:
- Integer, character, string, date
Or a subrange of a standard data type:
- Integers > 47 && < 75
Or an enumerated data type where there is an explicit list of values
- (a,b,c,d,e,f,g) - 19Entity Integrity ConstraintThe Entity integrity constraint specifies that:
- No primary key value can be NULL
- The primary key value must be UNIQUE - 20Referential Integrity ConstraintsApplies to two relations:
- Maintains consistency between the relations
- If a foreign key exists in a relation, its value must either refer to an existing record in the relation it references or be wholly null. - 21Enterprise Constraintsaka "Business Rules" also known as general constraints
- 22Example of Enterprise constraintsThere may be a maximum of 20 staff members in a department.
- 23The Three Level ArchitectureIdentifies the three distinct levels at which data items can be described:
- External Level
-Conceptual Level
- Internal Level - 24Objectives of the 3LAPrimary objective is to separate each users' view of the database from the way it is physically represented.
- 25Why is the 3LA desirable? (1/5)Each user should be able to access the same data, but have a view that is relevant to them,
- 26Why is the 3LA desirable? (2/5)Users should not have to deal with physical database storage issues such as file structures.
- 27Why is the 3LA desirable? (3/5)The DBA should be able to change the database storage structures without affecting the users' views.
- 28Why is the 3LA desirable? (4/5)The internal structure of the database should be unaffected by changes to the physical aspects of storage, such as moving to a new storage device.
- 29Why is the 3LA desirable? (5/5)The DBA should be able to change the conceptual structure of the database without affecting all users.
- 303LA - The External LevelThe users' view of the database.
Each user has a view of the 'real world' that is relevant to them.
(Eg. Student records system - Staff view and - Student view) - 313LA - The Conceptual LevelThis level contains the logical structure of the database. (Eg. Entities, constraints)
It supports the external level in that every view must be derivable from the conceptual level. - 323LA - The Internal LevelCovers the physical implementation of the database to achieve optimal run-time performance and storage space utilization.
- 33What is Data Independence?Data independence means that changes in the different levels of the 3LA will not affect higher levels.
- 34Data Independence - Logical data independenceThe immunity of the external schema to changes in the conceptual schema.
(Eg. addition of new entities, attributes, relationships) - 35Data Independence - Physical data independenceImmunity of the conceptual schema to changes in the internal schema.
(Eg. modification of indexes, storage devices or file organizations.
Informações
- Descrição
- Introduction to Databases and the Relational Model
- Criado por
- jaydeeees
- Visualizações
- 4
- Avaliação