3.2.1
Databases
Records
Records
Structured data refers to any data that resides in a fixed field within a record or file so that it can be easily entered, stored, queried, and analysed.
![Illustrative background for Records](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/1.1.1 Measuring length, volume, etc.../paper-1849364_640-min,h_400,q_80,w_640.jpg)
![Illustrative background for Records ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/1.1.1 Measuring length, volume, etc.../paper-1849364_640-min,h_400,q_80,w_640.jpg)
Records
Records
- Records are made up of fields.
- For example, a person could be represented as a record where the fields include their name, age, and address.
![Illustrative background for Comma separated values (CSV)](https://image-v2.cdn.app.senecalearning.com/2018-08/81c71177-dbf8-4115-b62f-b6ff22707f97/apostrophe-comma-,h_400,q_80,w_640.jpg)
![Illustrative background for Comma separated values (CSV) ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-08/81c71177-dbf8-4115-b62f-b6ff22707f97/apostrophe-comma-,h_400,q_80,w_640.jpg)
Comma separated values (CSV)
Comma separated values (CSV)
- One method of storing a record is using comma separated values.
- Each record is put on its own line.
- Each field is separated by a special character such as a comma.
![Illustrative background for Pros and cons](https://image-v2.cdn.app.senecalearning.com/2018-05/d02fc304-19d2-4611-a75e-08d788b5e2cd/letters-656514_960_720,h_400,q_80,w_640.png)
![Illustrative background for Pros and cons ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-05/d02fc304-19d2-4611-a75e-08d788b5e2cd/letters-656514_960_720,h_400,q_80,w_640.png)
Pros and cons
Pros and cons
- Pros:
- Very simple, text-based format.
- Can be read by many applications.
- Easy to use in programs.
- Cons:
- Inefficient for large datasets.
- Can only store text data.
- No built-in means of sorting or searching.
Flat-File Databases
Flat-File Databases
Flat-file databases are used to store records of information in order to be searched or queried at a later date.
![Illustrative background for Structure of flat-file databases](https://image-v2.cdn.app.senecalearning.com/2020-03/1d20263c-6601-4ebf-80a2-f66dd7f8459a/Flat-file-database-min,h_400,q_80,w_640.png)
![Illustrative background for Structure of flat-file databases ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-03/1d20263c-6601-4ebf-80a2-f66dd7f8459a/Flat-file-database-min,h_400,q_80,w_640.png)
Structure of flat-file databases
Structure of flat-file databases
- A flat-file database is one that has a single table to store data about an 'entity'.
- The table stores data in fields (columns) such as date of birth.
- A record (row) of information is a complete set of fields put together.
- This could be a person's details such as name, address, date of birth, telephone number.
![Illustrative background for Redundancy](https://image-v2.cdn.app.senecalearning.com/2020-02/b91eb7ed-86d9-4b3e-8c39-8521c1be68ee/data-numbers,h_400,q_80,w_640.jpg)
![Illustrative background for Redundancy ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-02/b91eb7ed-86d9-4b3e-8c39-8521c1be68ee/data-numbers,h_400,q_80,w_640.jpg)
Redundancy
Redundancy
- Redundant data is data that is repeated in a database.
- A single table file is inefficient as it is full of redundant data
![Illustrative background for Primary key](https://image-v2.cdn.app.senecalearning.com/2018-09/f93be445-5f4d-431b-99a8-dbce03272add/facts-magnifying-glass-,h_400,q_80,w_640.jpg)
![Illustrative background for Primary key ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-09/f93be445-5f4d-431b-99a8-dbce03272add/facts-magnifying-glass-,h_400,q_80,w_640.jpg)
Primary key
Primary key
- A primary key is a field used to uniquely identify a specific row of data in a table.
- For example, each student in a college database will have a student ID number that is unique to each student that can be used as a primary key
Relational Database
Relational Database
A relational database is a set of tables whose records are linked by certain fields.
![Illustrative background for Relational database](https://image-v2.cdn.app.senecalearning.com/2020-08/055ffa43-eeae-4950-9719-1fe8b9c5fe60/database-schema-1895779_1280,h_400,q_80,w_640.png)
![Illustrative background for Relational database ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/055ffa43-eeae-4950-9719-1fe8b9c5fe60/database-schema-1895779_1280,h_400,q_80,w_640.png)
Relational database
Relational database
- A relational database is a set of tables whose records are linked by certain fields.
- Each table contains data on one entity e.g. students or parents.
- When you link one table to another, this is known as a relationship.
- Each table then has a relationship to other tables using primary and foreign keys.
![Illustrative background for Foreign key](https://image-v2.cdn.app.senecalearning.com/2020-08/e3ce3ba3-6fae-452e-867d-eb6f8df69a8c/Screenshot%202020-08-21%20at%2017.05.18-min,h_400,q_80,w_640.png)
![Illustrative background for Foreign key ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/e3ce3ba3-6fae-452e-867d-eb6f8df69a8c/Screenshot%202020-08-21%20at%2017.05.18-min,h_400,q_80,w_640.png)
Foreign key
Foreign key
- If the primary key of one table is placed into another table, this is then known as a foreign key.
- For example, when a student ID field is added to a parent table to link you to your parents accounts, that student ID is a primary key in the student table but becomes a foreign key in the family table.
- The parents table will have its own primary key.
![Illustrative background for Secondary key](https://image-v2.cdn.app.senecalearning.com/2020-08/eceec273-02d9-407d-8ca0-065cbdfa88e5/Screenshot%202020-08-21%20at%2017.05.16-min,h_400,q_80,w_640.png)
![Illustrative background for Secondary key ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/eceec273-02d9-407d-8ca0-065cbdfa88e5/Screenshot%202020-08-21%20at%2017.05.16-min,h_400,q_80,w_640.png)
Secondary key
Secondary key
- A secondary key may also be kept by the database.
- A parent may not know their child’s student ID, but they will be able to locate their last name in the database.
- Secondary keys do not need to be unique.
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
Jump to other topics
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
![Go student ad image](/en-GB/revision-notes/_next/image?url=%2Fen-GB%2Frevision-notes%2Fimages%2Fgo-student-uk-ad.jpg&w=640&q=100)
Unlock your full potential with GoStudent tutoring
Affordable 1:1 tutoring from the comfort of your home
Tutors are matched to your specific learning needs
30+ school subjects covered