Week 2 Flashcards
What are the two main components of designing a database
Database design and application design
What does database design entail
designing the conceptual schema
As well as physical and implementation schema
What does application design focus on
DONT NEED TO NO MUCH AS IT IS CONSIDERED PART OF SOFTWARE ENGINEERING
focuses on the programs and interfaces that ACCESS the database
What is the first thing you need before you can even think about designing a schema
A specification - The requirements the database must follow
eg:
an employee can only work for one department …
What are the main concepts of an entity relationship model
.ENTITIES ( the objects)
.ATRIBUTES ( the properties of the entities)
. RELATIONSHIPS ( between 2 or more entities)
2 types of entities
. physical
. Non physical
Features of an attribute
.has an associated value
eg :
Name - “Abdullahi Mohamed”
ID - 1234543
. has an associated data type
Integer, double, string …
What are the types of attributes and define them
Simple attribute - cannot be divided into further components (Atomic)
eg Kings_ID - k123456
composite attribute attribute - can be divided into further components
Name( FirstName_ , MiddleName_ , LastName_ )
Address (Street, postcode city)
Employees with the same basic attributes can be grouped into an …
Entity type
eg employees can be grouped into entity type EMPLOYEE
What is a key attribute
an attribute of an entity in an entity type that has a unique value for each entity
eg Student_ID (of STUDENT)
CAN UNIQUELY IDENTIFY EACH ENTITY IN AN ENTITY TYPE
Key attribute underlined in ER diagram
How are attributes displayed in the ER Diagram
As an oval connected to the entity
How are multi valued attributes displayed in ER
as a double oval
How are key attributes displayed
underlined
How are composite attributes displayed
components connected to the oval representing the composite attribute
What is an entity set
The current state of entities of that type that are stored in the database
Detailed desciption-
The set of of all the instances that are in the empty set along with the data of all those instances
eg :
Instance - car 1
123(registration) , blue (colour) …
Instance car 2
.
.
.
What is the degree of a relationship type and hence what is a binary relation
The number of entity types the relationship affects
eg Works_ON - relates EMPLOYEE and PROJECT and so is a binary relation
How are relationship types represent in an ER diagram
A diamond box where straight lines connect the relevant entity types
What is a recursive relationship type
relation acts on one entity (unary relation)
eg employee supervises another employee
SUPERVISES is recursive
Define and explain what a weak entity type is
An entity type that does not have a key attribute
.identified by the PARTICULAR ENTITY (that the weak entity is related to the particular entity)
AND
.a partial key ( that uniquely identifies weak entities that are related to the same owner entity
(participates in an identifying relationship type)
represented by a double rectangular box
eg:
DEPENDENT is a weak entity type
. A DEPENDENT entity is identified by the dependent’s first name,
and the specific EMPLOYEE with whom the dependent is related
. EMPLOYEE is its identifying entity type via the identifying
relationship type DEPENDENT_OF
. Name of DEPENDENT is the partial key
what is total participation
Total participation in a relationship requires every entity in one set to participate.
In a university database, if “Enroll” has total participation ( where a student enrolls for a course )from “Student,” every student must be enrolled in at least one course.
what is partial participation
If there is partial participation from the “Student” side in a relationship with “Course,” it means that not every student is required to be enrolled in a course. Some students may not be enrolled in any courses.
partial - some entities required to participate but others are not
What is zero participation
Entities have the option of whether they want to participate in relationship
In a university database, if there is zero (optional) participation from the “Student” side in a relationship with “Course,” it means that some students may not be enrolled in any courses. They have the option to participate in the relationship, but it’s not mandatory.
Instead of using cardinality ratio and existence dependency constrain we can use … instead
min , max notation
How is total participation display in ER diagram
double line
How is partial display
single line
What is a derived attribute
An attribute whose value can be derived from one or more other related attributes
eg: Age can be derived from Date of Birth
represented as a dashed attribute in er diagram