Serial files are files are a permanent storage of data where the data is
stored in the order in which it was entered, with no order to the data and
useful for storing transactional data and initialisation files.
Sequential files store data in order of a key field and the order is
maintained, it is useful for storing master files. Indexed sequential files
maintain an index to allow groups of records to be accessed quickly.
Databases are structured, persistent collections of data. A database
makes processing efficient and reduces storage requirements and avoids
redundancy. They are managed by DBMS, it provides: a manipulation
language, integrity to ensure efficiency and structure is not compromised,
additional security, an interface for other programs to access and sue the
data, and program independence.
Databases contain: tables with rows (records or tuples) and columns
(fields or attributes), queries, they create forms and reports.
Flat file is one table whereas relational database and normalisation is
multiple related tables.
Entity relationship modelling: tutor group-<students-<subjects studied
May to many cannot be modelled: cars>-<parts, however it is broken into
car-<car parts>-parts
A relational database is a type of database that stores and provides
access to data points that are related to one another. Data is organized
into tables (also called relations), which consist of rows and columns. Each
table represents an entity, and each row in a table represents a record of
that entity. Relationships between tables are established using keys.
Attribute is a column in a table that represents a specific piece of
information about an entity. For example, in a Book table, attributes might
include Title, Genre, and AuthorID.
Primary Key is a unique identifier for each record in a table. It ensures that
each record can be uniquely identified. For example, BookID in a Book
table.
Composite Primary Key is a primary key that consists of two or more
attributes combined to uniquely identify a record. For example, in a
CourseEnrollment table, a composite primary key might be StudentID and
CourseID together.
Foreign Key is an attribute in one table that links to the primary key of
another table, establishing a relationship between the two tables. For
example, AuthorID in the Book table is a foreign key that references
AuthorID in the Author table.
Repeating data is not efficient. When designing a database table, you
need to consider your list of fields and decide which will have the same
data in a number of records, these will have to be moved into another
table.
Normalisation is the process of organizing a database to reduce
redundancy and improve data integrity. The goal is to ensure that each
piece of data is stored only once.
Steps to Normalize to 3NF
1. First Normal Form (1NF):