Vous êtes sur la page 1sur 9

Chris Grenard Wednesday, October 15, 2008

Assignment #4

P. 129, #1
Define each of the following terms:
Entity type – a group of objects that share the same properties and behaviors
Entity-relationship model – a graphical/logical depiction of the data for a business
or area of a business
Entity instance – a single representation of an entity type
Attribute – the nouns that a business uses in its course of operations. Examples of
attributes are: Customer_Name, Item_Description, etc.
Relation type - a relevant association between entity types
Identifier – A unique ID for an entity. A primary key in database terms.
Multivalued attribute – an attribute that may have more than one value for a given
entity
Associative entity – an entity type that links one or more entity types and contains
data that is not exactly related to another entity instance.
Cardinality constraint – the number of instances an entity can or must be associated
with another entity.
Weak entity – an entity that is dependent on another entity for its existence.
Identifying relationship – the relation between a weak entity type and its owner
Derived attribute - a value that is computed from existing data
Business rule – a statement that defines or constrains some aspect(s) of the
application logic.

P. 130, #3
Contrast the following terms:
Stored attribute; derived attribute
A stored attribute is data that is already stored in a database whereas a derived
attribute is computed from existing stored attributes.

Chris Grenard CSC602 Assignment 4


Simple attribute; composite attribute
A simple attribute is an attribute that cannot broken down further whereas a
composite attribute has component parts.
Entity type; relationship type
Entity types are entities that share common properties and behaviors; a
relationship type is a meaningful between entity types
Strong entity type; weak entity type
A strong entity type exists independent of any other entity type; a weak entity
types depends on a strong entity type for its existence
Degree; cardinality
Degree is the number of entities that participate in a relationship; cardinality
states how the entities are related and how many instances of each entity must
participate in a relationship.
Required attribute; optional attribute
A required attribute must be supplied for a given entity instance, an optional
attribute is not required for a given entity instance
Composite attribute; multi-valued attribute
A composite attribute contains relevant component parts; a multi-valued attribute
may have more than one value for an entity.

P. 130, #7
State the six general guidelines for naming data objects in a data model.
1. Relate to business, not technical characteristics
2. Be meaningful
3. Be unique
4. Be readable
5. Be composed of words taken from an approved list
6. Be repeatable

Chris Grenard CSC602 Assignment 4


P. 130, #10
List the four types of cardinality constraints, and draw an example of each.
1. Mandatory One
2. Mandatory Many
3. Optional One
4. Optional Many

P. 130, #14
Give an example of each of the following, other than described in this chapter.
a. Ternary relationship

Chris Grenard CSC602 Assignment 4


b. Unary relationship

Is part of TEAM

TEAM
CAPTAIN

P. 130, #20
Explain the distinction between entity type and entity instance.
An entity type is a group of entities that share the same properties and behaviors; an
entity instance is a single occurrence of an entity type.

P. 131, #3
There is a bulleted list associated with Figure 3-22 that describes the entities and their
relationships in Pine Valley Furniture. For each of the ten points in the list, identify the
subset of Figure 3-22 described by that point.

I don’t understand this question.

Chris Grenard CSC602 Assignment 4


P. 131, #4a Draw ERD of the following situation.
A company has a number of employees. The attributes of EMPLOYEE include
Employee_ID (identifier), Name, Address, and Birthdate. The company also has several
projects. Attributes of PROJECT include Project_ID, (identifier), Project_Name, and
Start_Date. Each employee may not be assigned to one or more projects, or may not be
assigned to a project. A project must have at least one employee assigned and may have
any number of employees assigned. An employee’s billing rate may vary by project, and
the company wishes to record the applicable billing rate (Billing_Rate) for each
employee when assigned to a particular project. Do the attribute names in this
description follow the guidelines fro naming attributes? If not, suggest better names.

Employee Project

PK EmployeeId PK ProjectId

Name ProjectName
Address StartDate
BirthDate FK1 EmployeeId
BillingRate

P. 131, #4b

A university has a large number of courses in its catalog. Attributes of COURSE include
Course_Number (identifier), Course_Name, and Units. Each course may have one or
more different courses as prerequisites or may have no prerequisites. Similarly, a
particular course may be a prerequisite for any number of courses or may not be
prerequisite for any other course. Provide a good definition of COURSE. Why is your
definition a good one?

A course is identified by its unique Course_Number and may have 0:M


prerequisites. If a course has a prerequisite, the student must have passed the perquisite
course.

Chris Grenard CSC602 Assignment 4


Course Prerequisites
PK,FK1 CourseNumber PK CourseNumber

CourseName PrerequisiteForCourseNumber
Units
Prerequisite

NBD DATABASE – Development Still In Progress

CREATE TABLE `nbd`.`Customer` (


`CustomerId` int(11) NOT NULL auto_increment,
`CustomerName` varchar(40) default NULL,
`CustomerAddress` varchar(40) default NULL,
`CustomerContact` varchar(40) default NULL,
`CustomerPhone` varchar(40) default NULL,
PRIMARY KEY (`CustomerId`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
COMMENT='NBD Customers'

CREATE TABLE `nbd`.`Item` (


`ItemId` int(11) NOT NULL auto_increment,
`ItemDescription` varchar(100) default NULL,
`UnitPrice` decimal(10,0) default NULL,
`QtyOnHand` int(11) default NULL,
PRIMARY KEY (`ItemId`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
COMMENT='NBD stock'

Chris Grenard CSC602 Assignment 4


CREATE TABLE `nbd`.`Order` (
`OrderId` int(11) NOT NULL auto_increment,
`CustomerID` int(11) NOT NULL,
`JobStartDate` date default NULL COMMENT ' ',
`Designer` varchar(50) default NULL,
PRIMARY KEY (`OrderId`),
KEY `FK_Order_Customer` (`CustomerID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='NBD Orders'

CREATE TABLE `nbd`.`OrderItem` (


`OrderId` int(11) NOT NULL,
`ItemId` int(11) NOT NULL,
`CustomerId` int(11) NOT NULL,
`QtyOrdered` int(11) NOT NULL,
PRIMARY KEY (`OrderId`,`ItemId`),
KEY `Order_Cust_FK` (`CustomerId`),
KEY `Item_Order_FK` (`ItemId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Ordered Items'

Chris Grenard CSC602 Assignment 4


Database Screenshot:

Chris Grenard CSC602 Assignment 4


Chris Grenard CSC602 Assignment 4