Chapter 16 - Database concepts Flashcards
What is an entity?
» Entity is a category of object,person,event or thing of interest to an organisation about which data is to be recorded
What does each entity in a database have?
» List of attributes/fields
What is another name for a simple database?
» Called a flat file, consiting of information about a single entity - consisting of a single file
What is the format of an entity discription?
» Entity1(Attribute1, Attribute2…)
What is an example of a discription for an entity which is called product?
» Product(Title,Subject,Author,Length)
What is needed to uniquely identify the entity?
» An Identifier
What is the identifier known as in a relational database?
» Primary key
What is the purpose of the primary key?
» To identify a particular record relationship database
What is the format for a primary key?
» Customer(CustId,title,firstname)
» CustId is the primary key in this instant as it is unique
Why is a secondary index needed
» To search the database quickly such as the surname in a patients file
What is a composite primary key?
» A primary key which consists of more than one attribute is called a composite primary key
What are the 3 different degrees of relationship between 2 entities?
» One-to-one
» One-to-many
» Many-to-many
What is an example of a one to one relationship?
» A husband and wife
What is an example of a one to many relationship?
» Mother and a child
» As a mother may have many children, but each child has the same mother
What is an example of a many to many relationship?
» Film and actor
What is the purpose of an entity relationship diagram?
» A diagrammatic way of representing the relationships between the entities in a databse
What 2 things needed to be specified in a E-R diagram?
» The degree of relationship
» The name of the relationship
Describe the E-R diagram of a Headteacher and a School
» One to one relationship
» Headteacher in charge of School
What is created in a relational database?
» A seperate table is created for each entity identified in thre system
What is the foreign key?
» An extra field/attribute that links the 2 tables
What is the purpose of the Foreign key?
» An attribute that creates a join between two tables
» Attribute that is common to both tables
» Primary key in one table is the foreign key in the table to which it is linked
What is the primary key indicated by?
» Asterisk
What is the foreign key indicated by?
» Italics
How is the one-to-one degree shown in an E-R diagram?
» A straight line
How is the one-to-many relation shown in an E-R diagram?
» A straight line from the entity which is the one relationship to a crows foot in the entity which is the many
How is the Many to Many relationship shown on an E-R diagram?
» 2 crows foots linking the entities
What are tables also reffered by?
» Relations
What is the structure of a relational database?
» Excel spreadsheet
» Each row containing entities
» Column containing attributes belonging to the records
What is a record?
» A row in a database
What is the problem of linking tables in a many-to many relaionship?
» Tables cannot be directly linked
How can you resolve the issued of tables not being linked in a many-many relation in an E-R diagram?
» An extra table is needed to linke the 2 tables
What is the important thing to remember when an entity is used in the a table?
» It is not delted in the table
What is Referential integrity?
» It is the logical dependency of a foreign key on a primary key
» Means the reference from a row in one table to another table must be valid
» Values in that key match the values in a key in a related table