Databases Flashcards
(17 cards)
Whats an Entity
An entity is a real-world object or concept about which information is stored in a relational database.
What is a relational database?
A database which recognises the the differences between entities by creating tables for each entity.
Example of entity and attribute model
Entity: Doctor and Patient
Attributes: DoctorID,Firstname,Patient ID
How does a relational database recognises the differences between entities
The tables have different names. Each table has a different primary key
Whats an attribute?
A Characteristic of an Entity
Whats a flatfile
Database that consists of a single file
What’s a primary Key
A unique identifier for each record in a table
What’s a foreign Key
An attribute which links two tables together. It exists as a primary key in one table and a foreign key in another
What’s a secondary Key
A key which is slightly unique and can make searching faster
What’s a one to one model
Each entity can be linked to one entity
Such as husband to Wife
What’s a one to many model
One table can be associated to many other tables
Like a teacher and students
Many To Many model
One entity can be associated with many other entities and the other way round
How would you draw/model it
Single link is just a straight line
Many link is a line with a branch
What’s normalisation
Process of coming up with the best layout
Attributes of normalisation
No Redundancy
Consistent Data throughout linked datas
Records can be added and removed without issues
Complex Queries can be carried out
What is required for it to be a first normal form?
There must be no attribute that contains more than a single value