Databases Flashcards
What is a data model?
An abstract model of which things to store and what information about them should be recorded.
What is an Entity?
An object, event, person or thing about which data is to be stored
What is an attribute?
Attributes are characteristics or other information about entities
How are databases formed?
They are formed of tables which are used to store multiple entities
What is the notation for an entity description?
Entity1 (Attribute1, Attribute2 ….)
-The primary key is always underlined
Example: Patient (Title, Firstname, Surname, Address, Email)
What is an entity identifier?
- An attribute given to each entity which is unique within that table.
- Also known as the primary key.
What is a requirement of primary keys (entity identifiers)?
They must be unique
What are the three types of relationships entities can have with each other?
One-to-one
One-to-many
Many-to-many
What is an Entity relationship diagram?
They graphically represent the relationships between tables/entities in a database
What does it mean when entities have a link between them in an Entity relationship diagram?
That the two entities are related in some way,
What 2 things show a relationship in an Entity relationship diagram?
- Both the degree and the name of the relationship need to be specified
- For example: Head teacher ——————– School
The degree: One-to-one
The name: In charge of
What type of key is formed of multiple attributes, combined to form the primary key?
A composite key
What is a composite primary key?
A key formed of multiple attributes, combined to form the primary key
(also known as just a composite key)
What is a primary key?
an attribute that uniquely identifies every entity in a database
What is a foreign key?
- An attribute that is a primary key in another table
- The attribute exists in both tables
How is the primary key and foreign represented in an entity description?
-The primary key has an asterisk next to it
For example: PatientID *
-The foreign key is in italics