Conceptual Design
Conceptual Design
ER (Entity Relationship) Model: The E-R model is a detailed, logical representation of the data for a business area. It is expressed in terms of entities in the business, the relationships, and the properties of the entities and relationships.
What is an Entity? An Entity is a person, place, object, event, or concept about which organization wishes to maintain data. Example Person: EMPLOYEE, STUDENT Place: CITY, STATE Object: MACHINE, AUTOMOBILE ER model Symbols: Strong Entity: Exists independently of other types. STUDENT, EMPLOYEE
Weak Entity: An entity type whose existence depends on other entity type. Example: entity DEPENDENT wont exists without another entity EMPLOYEE/ ASSOCIATE Represented with What is a Relationship and how it is represented? Relation ships are glue that holds together the various components of E-R model. An association among the instances of one or more entity types.
What is a Associative Entity and how it is represented? An entity that associates the instances of one or more entity types and contains values that are peculiar to relationship between those entities
Flight_No
Date
Captain_ Name
FLIGHT
What is multi-valued Attribute and how it is represented? An attribute that may take on more than one value for a given entity instance Represented with double Ellipse
Example: For an EMPLOYEE entity Skill_Set can be considered as week attribute What is derived attribute and how it is represented? An attribute whose value can be calculated from related attribute values. Represented with dotted ellipse
Example: For an EMPLOYEE entity, attribute Years_Employeed is derived. This can be derived from the Date_Joined attribute Exercise 1. Draw an ER diagram for the following. A company purchases items from a number of different vendors, who then ship the items to the manufacturer. The items are assembled into products that are sold to customers who order the products. Each customer order may order one or more products. What is Relational Structure? We can express the structure of a relation by a Tuple, a shorthand notation The name of the relation is followed (in parentheses) by the names of the attributes of that relation, e.g.: EMPLOYEE1(Emp_ID, Name, Dept, Salary) Relational Keys Must be able to store and retrieve a row of data in a relation, based on the data values stored in that row A primary key is an attribute (or combination of attributes) that uniquely identifies each row in a relation. The primary key in the EMPLOYEE1 relation is EMP_ID (this is why it is underlined) as in: EMPLOYEE1 (Emp_ID, Name, Dept, Salary) Super Key: An attribute (or combination of attributes) that uniquely identifies each entity in a table. Candidate Key: A minimal super key. A super key that does not contain a subset of attributes that is itself a super key. Primary key: A candidate key selected to uniquely identify all other attribute values in any given row. Cannot contain null entries. Foreign Key: A key is used when we must represent the relationship between two tables and relations A foreign key is an attribute (possibly composite) in a relation of a database that serves as the primary key of another relation in the same database.
Example EMPLOYEE1 (Emp_ID, Name, Dept_Name, Salary) DEPARTMENT (Dept_Name, Location, Fax) The attribute Dept_ Name is a foreign key in EMPLOYEE1. It allows the user to associate any employee wit the department they are assigned to. Some authors show the fact that an attribute is a foreign key by using a dashed underline. How to express Conceptual Schema? Text statements have the advantage of simplicity, whilst the graphical representation provides a better means of expressing referential integrity constraints Here is a text description for four relations: CUSTOMER(Customer_ID, Customer_Name, Address, City, State, Zip) ORDER(Order_ID, Order_Date, Customer_ID) ORDER_LINE(Order_ID, Product_ID, Quantity) PRODUCT(Product_ID, Product_Description, Product_Finish, Standard_Price, On_Hand)
What What What What What What What What What What What What
is ER Model? can be done with ER Model? is the symbol used to represent Entity? is the symbol used to represent weak Entity? is the symbol used to attribute? is the symbol used to derived attribute? does it mean an attribute is multivalued? is a primary key? is a foreign key? is a Candidate key? is a Super key? is the indication of underlining an attribute in Conceptual design?