Databases Flashcards
What is a Database?
A database is an organised, persistent collection of data.
Organised: Data organised into tables, records and fields
Persistent: Non-volatile using secondary storage
Data: Raw info with no context
What does a database consist of?
Files, records and fields
What operations can be performed on databases?
- Can be organised/sorted in numerous ways
- Displayed/Printed in a variety of styles/layouts
- Searched for info and updated
- Backed up easily and automatically
- Local or distributed
- Stored/Moved easily
What is an attribute?
An individual fact, detail or characteristic of an entity (aka a field)
What is an entity?
A thing, person, object or relationship about which data can be collected
What is a flat file database?
A database containing a single table
What is a primary key?
A unique piece of information within a table to identify a record
What is a foreign key?
A field in the table which contains the value of a primary key in another table (links to one record)
What is redundancy?
Duplication of data within a database
What is a record?
A collection of fields/attributes about the same thing, person, object or relationship in a table
What is a relational database?
A database with multiple linked tables
What is a conceptual data model
a representation of the data requirements constructed in a way that is independent of any software used to construct the database
Click to view a relationship example
e.g.
Entities:
Student, Teacher, Class, Subject, Classroom…
Attributes:
Student: first name, second name, DOB, student number, year group, form ▪ Teacher: first name, last name, Subject, Teacher ID, DOB
Subject: Subject ID, Requirements, Max Intake
Classroom: Room ID, capacity, room type, facilities
Class: Class ID, Classroom ID, Subject ID, Teacher ID, Period, Time
Relationships:
Teacher teaches Subject
Student attends Class
Entities in a system like this are always singular. The entity describes the characteristics of one instance of the entity, a so-called entity occurrence.
What shape denotes an entity set?
A rectangle
What shape denotes an attribute?
An oval
What shape denotes a relationship?
A diamond
Primary Key Attributes (PK)
uniquely identify each entity occurrence, it is a field that is unique for each record within a table
Foreign Key Attributes (FK)
are found on the ‘many’ (or ‘one’ in a one-to-one) side of a relationship and always take the same values as the primary key attribute in a linked entity. They define the relationship.