4.10 - Fundamentals of databases Flashcards
What is an entity in a database? (2 points)
Something used to represent an object in the real world that can be distinguished from other objects
Can be a physical object (such as a person or a place) or a concept (such as an activity or a task) for which we need to record data in the database
What is an attribute in a database? (2 points)
Something used to represent a property, a quality or a characteristic that describes an entity
E.g. the name of an employee, or the date and time that a booking was submitted
What are the 2 types of identifiers in a databse?
Entity identifier/key attribute - an attribute/set of attributes used to uniquely identify each instance of an entity
Composite entity identifier - a set of the minimum number of possible key attributes combined together
What are the 3 types of database relationships?
One-to-one - whenoneinstance of an entity is associated withonly oneinstance of another entity
E.g. each school is run by one head teacher
One-to-many - whenoneinstance of an entity is associated withmore than one instance of another entity
E.g. each student books many appointments
Many-to-many - whenmore than one instance of an entity is associated withmore than one instance of another entity
E.g. many students are taught by many teachers
Define ‘relational database’.
A database where separate tables are made for each entity, and
relationships between entities are represented by foreign keys
What are the 3 types of keys used in a database?
Primary key - a unique identifier that identifies each record in a table
Composite primary key - a primary key made up from two or more other keys
Foreign key - a linking attribute that joins two tables in a relational database by being a primary key in one and a foreign key in the other