Lecture 1 Flashcards
What is an Algorithm?
An algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value or set of values as output
An algorithm can be seen as a tool for solving a well-specified computational problem.
What is a Flat Database?
Stores information about a single entity
1 table
Disadvantages of a Flat database?
Separation and isolation of data.
Duplication of data.
Data dependence.
Incompatibility of files.
Fixed queries and the proliferation of application of programs.
A solution to this is to use a relational database.
What is a database?
A consistent store of data
What is first normal form?
No repeated or similar data
Each row is unique i.e. it has a primary key
Data has to be atomic
What is second normal form?
Non-key attributes must depend on every part of the primary key
The table must already be in first normal form
What is third normal form?
It is already in 2NF
There are no non-key attributes that depend on another non-key attribute
Entity relations
one to one-husband and wife
one to many-mother and child
many to many-actor and film
Define a primary key?
A unique identifier for each record
Define a foreign key?
A foreign key is an attribute that creates a join between two tables (relations).It is the attribute that is common in both tables.
It is the primary key in the first relation
Define a secondary key?
A secondary key is a field in a table that can be used to access the data in different ways. It is used to search for a group of records.
What is a DBMS?
a database management system defines, creates and maintains a database. The DBMS also allows controlled access to data in the database
Includes a data dictionary which is a file of descriptions of the data and structure
Views of data: Internal level
This is the view of the entire database store in the system. It is hidden from the user by the DBMS.
Views of data: Conceptual level
Gives a single usable view of all the data on the database
Views of data: External level
Where data is arranged according to user requirements and rights. Different users will get different views of the data.