Title: Invoicing Problem
1Invoicing Problem
CUSTOMER list contains potential as well as
actual customers. A customer on this list may not
(yet) have made any purchase that would generate
an invoice. INVOICE is optional to CUSTOMER.
Some products kept in inventory are never sold
and may, therefore, never show up in an invoice.
INVOICE is optional to PRODUCT. So, the LINE
becomes optional to PRODUCT, because an unsold
product will never appear in an invoice line.
2Developing an E-R Diagram
- The database design is iterative (repetitive)
process - Iterative Process is based on repetition of
processes and procedures - Step1 General story of organizational operations
and procedures - Step2 Basic E-R Model graphically drawn and
reviewed - Step3 Modifications made to include newly
discovered E-R components - Repeat process until designers and users agree
that the E-R Diagram is a fair representation of
the organizations activities and functions - During the design process, database designer
- Makes interviews to help define entities,
attributes, and relationships - Examines business forms and reports that an
organization uses in its daily operations.
3Tiny College (TC)
- Tiny College is divided into several schools a
school of business, a school of arts and
sciences, a school of education, and a school of
applied sciences. - Each school is administered by dean. Each dean
is assigned to only one school.
GOOD DATABASE DESIGN REQUIRES THE DESIGNER TO
CONSIDER THE INFORMATION REQUIREMENTS and THE
ORGANIZATIONS BUSINESS RULES!
4- In the Tiny Colleges operational environment,
employees have some common characteristics (name,
address, phone, etc.) - The professors have some professional
characteristics (academic degree, academic rank,
etc.) None of other employees (secretaries,
drivers, mechanics, etc.) is required to have
such academic attributes.
- 11 relationship. EMPLOYEE is a PROFESSOR.
- Not all employees are professor, so PROFESSOR is
optional to EMPLOYEE (Employee is
not required to be a professor).
5First ERD Segment Established
- Deans hold professional rank (position, status)
and may teach a class. - Each school is composed of several departments.
6Second ERD Segment Established
- Each department offers several courses.
- Note that the relationship is based on the way
Tiny College operates. If Tiny College had some
departments that were classified as research
only, such departments would not offer courses
and, therefore, the COURSE entity would be
optional to the DEPARTMENT entity.
7Third ERD Segment Established
- CLASS is a section of a COURSE. A department may
offer several sections (classes) of the same
course. - Each of those classes is taught by a professor
at a given time and in a given place.
- However, because a course may exist in Tiny
Colleges course catalog even when it is not
offered as a class in a current term. CLASS is
optional to COURSE.
8Fourth ERD Segment Established
- Each department has many professors assigned to
it. - One of those professors chairs the department.
- Only one of the professors can chair the
department to which (s)he is assigned, and no
professor is required to accept the chair
position. Therefore, DEPARTMENT is optional to
PROFESSOR, in the chairs relationship.
9Fifth ERD Segment Established
- Each professor may teach up to four classes,
each one a section of a course. A professor may
also be on a research contract and teach no
classes at all.
10Sixth ERD Segment Established
- A student may enroll in several classes.
- Each student may enroll in up to six classes,
and each class may have up to 35 students. - So, the relationship between STUDENT and CLASS
is MN. - This MN relationship must be divided into two
1M relationships through the use of the ENROLL
entity.
- Because a CLASS can initially exist (at the
start of the enrollment period) even though no
students have enrolled in it, STUDENT is optional
to CLASS in the MN relationship. The optional
symbol is next to ENROLL if a class exists that
has no students enrolled in it, that class never
occurs in the ENROLL table.
11Seventh ERD Segments Established
- Each department has many students whose major is
offered by that department. - Each student has only a single major.
12Eighth ERD Segment Established
- Each student has an advisor in his or her
department. - Each adviser advises several students.
- An advisor is also a professor, but not all
professors advice students. Therefore, STUDENT is
optional to PROFESSOR in the PROFESSOR advises
STUDENT relationship.
13Ninth ERD Segment Established
- A class is taught in a room.
- Each room is located in a building. So, BUILDING
can contain many ROOMs, but each ROOM is found in
a single BUILDING. - Some buildings do not contain (class) rooms. (A
storage building might not contain any named
rooms at all).
14Components of E-R Model
15Challenge of Database Design Conflicting Goals
- Database must be designed to conform to design
standards - High-speed processing may require design
disagreements - Search for timely information may be the focus of
database design - Other concerns
- Security
- Performance
- Shared access
- Integrity