file base approach
The data is stored in one or more separate computers files
Relational database
Is a way of structuring information in tables, rows and columns.
What are the limitations of using a file based
Data redundancy (data is repeated in more than one file)
Data dependency (changes to data means changes to program accessing the data)
Lack of data integrity (entries that should be same can be different in different places)
Lack of data privacy (all users have access to all data if a single flat file)
What are the benefits of relational database instead of flat file?
Reduce data redundancy
Reduce data dependency
Improve data integrity
Improve data privacy
Program-data independence
Ability to create ad hoc queries (queries designed for a particular purpose)
Describe the features of relational database that address the limitations of files based approach
Multiple tables are linked together
which reduces data redundancy
increase data integrity
referential integrity can be enforced
Program data independence means that
structure of data can change and does not affect program
structure of program can change and does not affect data
Complex queries can be more easily written
to find specific data
Different user can be given different access rights
which improves security
Different users can be given different views of the data
so they do not see confidential information and data privacy is maintained
Entity
The concept or object in the system that we want to model and store information about
Attributes
A data item, represented as a field within a table
Primary key
A unique identifier for each tuple
Foreign key
Describe the role of a primary and a foreign key in a database relationship?
primary key uniquely identifies each tuple
primary key can be used as a foreign key in another table
to form relation between the tables