C2028 Database Management System Term 3 2008 Assignment, part 1
Hi All!
This is the assignment of C2028 Database Management System that I do in Term 3 2008 in my IADIC (International Advanced Diploma in Computing) course from Informatics Computer School Singapore.
This module talks about many factors of a Database system. And this assignment focuses on the Normalization process.
So, basically this assignment ask us to design a database for a library using ERD (Entity Relationship Diagram), then do the normalization process to the designed database, we go from first normal form until the third normal form.
Here is the assignment question:
You are to develop a Library database system.
(i) Candidates must provide a description of current business activities and operations, a list of Business Rules.
(ii) Design and derive the following from the above system:
• Identify of objects – Entities, Relationship and Attributes
• Identify and include Primary Keys.
• Normalization the relationship (At least in 3NF).
• Draw Final ER Diagram.
In this assignment, I will develop a database system for a library. The database developed here will be built in a way that makes it suitable to support the operation of a library. So we need to identify the environment for the database (Library’s business) and identify all the entities and relationships that is needed to support the library, by doing it that way we can make sure that the database that we develop for the library will be suitable and able to support the library’s operation and management. There are two main parts in this assignment. The first part that describe more on the library’s business, and the second part that explain more on the library database itself.
In the first part, we will discuss about the business activities, operations, and business rules of the library itself. The database that we build for the library must be suitable for the library’s business so it can support the library effectively, that is why we need to identify the particular library’s business activities, operations, and business rules.
The second part of this assignment will explain technical side of the library’s database. I will try to identify what are the entities are there in the library’s system, how the relationships between those entities, and what are attributes that belong to each entity. After identifying these things, then I will move on to identify the primary key field for each table that is present in the library database. Before commencing to draw the final Entity Relationship diagram, we will try to observe if there is any relationship that can be normalized, if so then we will do all the necessary relationship normalization. Finally, I will draw the final Entity Relationship diagram for this library database system.
The main business activity of the library is manages its collection of books, accept new membership registration, lending books to members, handling book reservation, and return of borrowed book.
The library needs to keep tracks of so many records. It has its list of books that need to be sorted in a way that will make it easy for someone to search for a book’s information. It also needs to do many data management for its member, books, and staffs. The library has many members, a vast collection of books, and many staffs with different positions such as librarian, security guard, cleaning staff, administration staffs, etc. For these reason, the library need a library database system that will support its daily operation.
In this section, I will list some of the business rules from the library that is important for the development of the library’s database system.
II.c.1. Member Rules
ü A person acquires library membership after he/she fills a form that tells his particular information such as name, address, e-mail, etc.
ü A member can borrow more than one book at a time by bringing the book to a librarian that is in duty who will process the borrowing process.
ü Each member can borrow book for maximum of 40 (forty) days.
ü Library member may do a book reservation by filling a form and then put the form in the reservation box.
II.c.2. Book Management Rules
ü Each library book is given a unique book identification number.
ü A member may not borrow book that status is a reference book.
ü The entire book in the library must be recorded for its title, author, publisher, number of pages, ISBN, etc.
ü Each book in the library is given a genre that will make it easier for people to have a brief image about what is the book’s theme.
II.c.3. Staff Rules
ü Each staff’s personal particular must be recorded.
ü Only staff with librarian position may facilitate a library member to borrow a book.
ü The salary of the staff is not defined by the position.
ü Some staff can be assigned as a supervisor for another library staff.
We will try to identify what are the objects that are needed in this library’s database system. These objects comprise of Entities, Relationship, and Attributes for each entity.
Entity is the main object where it can represent a person, a place, an event, or a specific thing that is needed by the library. For example, we may have library member or book as an entity in a library database. Entity is the main object that most likely will become a table in a relational database system. So, if we have an entity called member, most likely we will have a table called member also in our database.
One entity can have many attributes. Attributes is the characteristic or we can also say that attribute is the property of an entity. For example, if we have an entity called book we may have some attributes for this entity such as book name, description, ISBN (International Standard Book Number), etc.
Relationship shows how one entity relates to another entity in the database system. There are many kinds of relationship.
Beside the explanation that I give about Entity in the previous section, there are also few other views of what an entity is. CR Vanslyke (knol, 2008) suggests that entity is a thing where the database will store the data. Therefore, in our developed database, we should be able to store data into entity that we found here.
Some things we can make as entity are:
a. Things or items that is countable.
b. Events or transactions, for example book borrowing.
c. People that are involved in the system
Now, we will look at what are the entities that we going to have in this library database system. We will only have what is important in the library database system to be the entity. Entities that we have here are:
- Member
- Staff
- Book
Member, Staff, and Book are three entities that are needed by this library database system.
The library will need to record its member that is why we have member as one of the entity. Additionally, the library can have many staffs including librarian, security officer, and so on, therefore, it is also important to have a record of the library staffs inside the staff entity. Finally, book is the main asset to a library, so definitely we will need to store data about all the library’s books.
Here I will try to identify what are the attributes for the three entities (Member, Staff, and Book) that we have identified in the previous section.
Attributes is the characteristic of our three entities. Mike Chapple (About.com, 2008) suggest that in database environment attributes, also known as field or column, is a single data item that is associated to each database entity.
Now, lets look at what are the attributes for each of our three entities:
1. Member
2. Staff
3. Book
The attributes that we will assign to each entity will be based on what data that we need to know from an entity. Additionally, all the attributes that I assigned to each entity here is considered as condition before any normalization process is done.
Attributes for each entity:
1. Member
a. member_id
b. name
c. gender
d. date_of_birth
e. address
f. phone_no
g. e-mail
h. borrow_id – (multivalued attribute)
i. book_borrowed – (multivalued attribute)
j. borrow_date – (multivalued attribute)
k. librarian_serve – (multivalued attribute)
l. book_duedate – (multivalued attribute)
m. return date – (multivalued attribute)
n. reservation_id – (multivalued attribute)
o. book_reserved – (multivalued attribute)
p. reserve_date – (multivalued attribute)
2. Staff
a. staff_id
b. name
c. gender
d. date_of_birth
e. address
f. phone_no
g. e-mail
h. position
i. salary
j. Supervisor
3. Book
a. book_id
b. ISBN
c. Title
d. Author
e. Publisher
f. Publication_year
g. Edition
h. Pages
i. Genre
j. Genre_description
k. Reference_book
That is all the attributes for each of our entity (Member, Staff, and Book). Of course this attributes refer to the condition before these entity attributes comes to the normalization process. We will do the normalization process in section III.c.
Relationship is a natural relation that is exist between entities in Entity Relationship Diagram, for example Member borrow Book (webfuse.cqu.edu.au, 2006).
There are some kinds of relationship degree: unary, binary, ternary, and n-ary relationship. Unary relationship is a relationship that involves only a single entity, or we can say that it is a relationship between an entity to itself. Binary relationship is a relationship that involves two different entities. Ternary relationship exists when the relationship involves three different entities. Finally, when we have a relationship with more than three entities involved, we call this kind of relationship as n-ary relationship (CR Vanslyke, 2008).
Now lets look at what relation that we have for our three entities that are Member, Staff, and Book. The relation that we will see here is the relation between entities before any normalization process is carried out.
Relations that we have between our entities here are:
1. Borrow
2. Reserve
3. Supervises
That are the three relations that we have for our entities in this library database system. In the next section we will discuss more about each of these three relations.
1. Borrow
Borrow is a ternary relationship involving the three entities Member, Book, and Staff. I will give a simple ERD (Entity Relationship Diagram) to show the borrow relationship.
Note: – M means multivalued attribute
The above ERD shows how the relations “borrow” relate all the three entities Member, Staff, and Book together. In a glance, this relation means that the library’s member can borrow books from the library facilitated by the library’s staff (librarian).
Now lets take a look at the signs at the relationship line there in the ERD. We can see that there are some signs like single line, circle, and crowfoot (/|\), these symbols represents the cardinality of the relation. The symbol closer to the entity is called as the maximum cardinality while the symbol next to it is called as the minimum cardinality. Maximum cardinality is the maximum number of entity instances that can be related to an entity. Minimum cardinality means the minimum number of instances that can be related to an entity. The circle symbol means zero or null, the line symbol means one, and the crowfoot symbol means many.
Using the cardinality symbol’s meaning we can get more information for “borrow” relation that is in the above ERD.
First, let us look at the Book entity. There is a circle symbol as the minimum cardinality and a crowfoot symbol as the maximum cardinality. It means that each of the library member can borrow minimum no books (not borrow anything) and also allowed to borrow more than one books.
Second, let us look at the Staff entity. There is a line symbol for both the minimum and maximum cardinality. This means that for each book borrowing events there must be minimum and maximum one staff (librarian) that facilitate the member to borrow the book.
Finally, let us look at the Member entity. We can see that there is a circle symbol as the minimum cardinality and a line symbol as the maximum cardinality. This means that each book in the library can be borrowed by no one or can be borrowed by maximum one member at a time.
2. Reserve
Reserve is a binary relationship between Member entity and Book entity.
Below is the Entity Relationship Diagram for the “reserve” relation.
Note: – M means multivalued attribute
The above ERD shows how Member entity and Book entity is related with the “reserve” relationship. This relation is needed to record the books reserved by the customer. Let us look at the cardinality of this relationship.
First, the cardinality symbols for the Book entity. There is a circle symbol as the minimum cardinality and a crowfoot symbol as the maximum cardinality. It tells that a library member can reserve no book or a member can return one or more than one book.
Second, the cardinality symbols for the Member entity. There is a circle symbol as the minimum cardinality and a crowfoot symbol as the maximum cardinality. It tells us that there can be no library member reserve a book (in case that no one reserve any book from the library) and also one library book can be reserved by many library members at a time.
3. Supervises
Supervise is a unary relationship that relates Staff entity with itself. This relation happen as a consequence that there is many job positions for the library staff’s and there are some library staffs that supervises the job of another library staff.
Below is the Entity Relationship Diagram for the “supervises” relation.
The above ERD shows how the unary relationship “supervises” relates the staff entity to itself. This relation will show who supervises who in the library’s staff. Now let us look at this relation with its cardinality.
First, let us look at the two cardinality symbols below the staff entity in the above ERD. We can see that there is a circle symbol for the minimum cardinality and a crowfoot symbol for the maximum cardinality. From these symbol we can get information that a library staff may supervises a minimum of no other library staff, or he/she can supervises many other library staffs.
Second, let us look at the cardinality symbols at the right side of the Staff entity. We can see that there is a circle symbol for the minimum cardinality and a line symbol for the maximum cardinality. The information that we can derive from these two symbols is that a library staff can have no supervisor (in case that he/she have the highest staff position in the library) or a maximum of one supervisor for each library staff.
In conclusion, we have three kinds of relationship for our three entities (Member, Staff, Book). These relationships are “borrow” which is a ternary relationship involving all the three entities, “reserve” which is a binary relationship relating the member and the book entity, and also “supervises” which is a binary relationship relating the staff entity to itself. These relation is for the library database system before any normalization process is done. We will do the normalization process in section III.c.
After we identify the Entities, Attributes, and Relationships among the entities in the previous section, I will try to identify the primary keys for each of the entity that we have here in our library database system.
Primary key is an attribute or combination of it that will uniquely define each of the entity’s instances. There should be no two instances with a same primary key attribute. Using a primary key, we can guarantee that there will be no duplicate instance for each of our entity. Therefore, each of the entity that we define in the previous section must have a primary key.
When selecting an attribute to be a primary key, we need to select an attribute that have no chance of having duplicate value. Below are some tables that show the entities that we have in this library database system together with its attribute and primary key attribute (bold and underscored attribute). These primary keys are before any relationship normalization is done.
| Member | |
| Primary Key | member_id |
| name | |
| gender | |
| date_of_birth | |
| address | |
| phone_no | |
| multivalued | borrow_id |
| multivalued | book_borrowed |
| multivalued | borrow_date |
| multivalued | librarian_serve |
| multivalued | book_duedate |
| multivalued | return date |
| multivalued | reserve_id |
| multivalued | book_reserved |
| multivalued | reserve_date |
Above is the table showing Member entity and its attributes. We can see that the member_id attribute is defined as the primary key. The reason why I choose member_id as the primary key for this entity is because we can assign a unique member id for each of the library’s member, so it will guarantee that we would not have any duplicate value in this attribute. Why other attribute does not qualify to be the primary key for this entity? It is because other attributes have a high chance to have more than one value same value.
| Staff | |
| Primary Key | staff_id |
| name | |
| gender | |
| date_of_birth | |
| address | |
| phone_no | |
| position | |
| salary | |
| Supervisor | |
Above is the table showing Staff entity and its attributes. We can see that the staff_id attribute is defined as the primary key. The reason why I choose staff_id as the primary key for this entity is because we can assign a unique staff id for each of the library’s staff, so it will guarantee that we would not have any duplicate value in this attribute.
| Book | |
| Primary Key | book_id |
| Primary Key | ISBN |
| Title | |
| Author | |
| Publisher | |
| Publication_year | |
| Edition | |
| Pages | |
| Genre | |
| Genre_description | |
| Reference_book | |
Above is the table showing Book entity and its attributes. We can see that the book_id and ISBN attribute is defined as the primary key. The reason why I choose book_id and ISBN as the primary key for this entity is because we can assign a unique book id for each of the library’s book and also different book have a different ISBN, so it will guarantee that we would not have any duplicate value in these two attributes.
In conclusion, in this section we have identified a primary key attribute for each of the entity that we have. We have member_id attribute as the primary key for the Member entity, we have staff_id attribute as the primary key for Staff entity, and book_id as the primary key for the Book entity. These primary key is before any relationship normalization, after some relationship normalization there is a chance that we will have more primary keys. We will do the normalization process in section III.c.
In this section, we will perform some normalization process for our three entities which are Member, Staff, and Book. In normalization, we will break down the complex entity and its relationship into smaller parts that is easier to understand and closer to the entities in the real world.
Tony Marston (tonymarston.co.uk, 2004) suggest that normalization is concerned with things like:
ü Identify the relationships between entity’s attribute
ü Combine some attributes to make a new relation
ü Combine relations to form a database
While the benefits of normalization are:
ü Eliminate redundancy
ü Make the model closer to the entity, process, and relationship in real world
ü Make a flexible data structure
There are three normalized form that we want to achieve, those are 1st Normal Form (1NF), 2nd Normal Form (2NF), and 3rd Normal Form (3NF). The following sections will discuss each transformation for our library database system to its 1NF, 2NF, and 3NF.
Before we do any normalization, we consider our library database system is in un-normalized form (UNF). To make our library database system to be in the first normal form (1NF), what we will need to do is to remove any repeating groups (multivalued attributes) and define all the necessary key attributes after removal of the repeating groups.
Before we do any normalization process to make our library database system to be in the first normal form (1NF), I would like to give an Entity Relationship Diagram (ERD) for the current un-normalized form:
Note: - M means multivalued attribute and - PK means Primary Key
III.c.1.i. Member Entity
As we can see in the ERD of the un-normalized library database system, there are many attributes in Member entity that is a multivalued attribute. They are borrow_id, book_borrowed, borrow_date, librarian_serve, book_duedate, return date, reserve_id, book_reserved, and reserve_date.
These multivalued attributes is intended to store data about library member’s book borrowing and book reserving activity. What is the book borrowing id (borrow_id), what book is borrowed by a member (book_borrowed), when he/she borrow it (borrow_date), who is the librarian who process the borrowing process (librarian_serve), when is the due date of the book (book_duedate), and when he/she actually return the book (return_date). For the book reservation activity, we have reserve_id that show the reservation id, book_reserved that store data about the reserved book, and reserve_date that shows when is the reservation is made. In order to eliminate these repeating groups, I will introduce the relation “borrow” and the relation “reserve” as a new table/entity.
In the new “borrow” entity, we will rename book_borrowed attribute to book_id and then we also rename librarian_serve attribute to staff_id. This is because the book that is borrowed by a library member can be identified by the book_id attribute as in the Book entity, and the librarian who serve the borrowing process can be identified by the staff_id taken from the Staff entity. The other attribute that we will put in the new “borrow” entity are member_id, borrow_date, book_duedate, and return_date. The primary key of this entity will be the borrow_id attribute.
| Member | |
| Primary Key | member_id |
| name | |
| gender | |
| date_of_birth | |
| address | |
| phone_no | |
| multivalued | reservation_id |
| multivalued | book_reserved |
| multivalued | reserve_date |
| Borrow | |
| Primary Key | borrow_id |
| member_id | |
| staff_id | |
| book_id | |
| borrow_date | |
| book_duedate | |
| return_date | |
For the new “reserve” entity, we will rename the book_reserved attribute to book_id taken from Book entity. The primary key will be the reservation_id and we also include the reserve_date attribute as one of the attribute in this entity.
| Member | |
| Primary Key | member_id |
| name | |
| gender | |
| date_of_birth | |
| address | |
| phone_no | |
| Reserve | |
| Primary Key | reservation_id |
| book_id | |
| reserve_date | |
Therefore, now we have removed all the repeating groups in the Member entity.
III.c.1.ii. Book Entity
In the Book entity, there is no attribute with multiple value, that means that there is no repeating group in this entity, therefore no modification need to be made in this entity to make it in the 1NF.
| Book | |
| Primary Key | book_id |
| Primary Key | ISBN |
| Title | |
| Author | |
| Publisher | |
| Publication_year | |
| Edition | |
| Pages | |
| Genre | |
| Genre_description | |
| Reference_book | |
III.c.1.iii. Staff Entity
In the Staff entity, there is no attribute with multiple value, that means that there is no repeating group in this entity, therefore no modification need to be made in this entity to make it in the 1NF.
| Staff | |
| Primary Key | staff_id |
| name | |
| gender | |
| date_of_birth | |
| address | |
| phone_no | |
| position | |
| salary | |
| Supervisor | |
The Entity Relationship Diagram (ERD) for the first normal form (1NF) is as follow:
1st Normal Form ERD. Note: - PK means primary key.
The second step of our normalization process is to make our library database system to its second Normal Form (2NF).
We identify that a relation is in the second Normal Form (2NF) if the relation satisfy two conditions. First, the relation must be in the 1NF (First Normal Form). Second, there are no partial dependencies, or we can say that the entire attribute in the entity is functionally dependent on the primary key only.
Since we have made our library database system’s relation to its first normal form (1NF) in the previous section, now we just need to identify the functional dependency from each of the entity that we have, and try to find if there is any partial dependency.
III.c.2.i. Member Entity
The primary key in Member entity is member_id
The functional dependency in this entity is:
member_id – - > name, gender, date_of_birth, address, phone_no, e-mail
Therefore, there is no partial dependency in this entity’s attributes.
III.c.2.ii. Staff Entity
The primary key in Staff entity is staff_id
The functional dependency in this entity is:
staff_id – - > name, gender, date_of_birth, address, phone_no, e-mail,
position, salary, supervisor
Therefore, there is no partial dependency in this entity’s attributes.
III.c.2.iii. Borrow Entity
The primary key in Borrow entity is borrow_id
The functional dependency in this entity is:
borrow_id – - > member_id, staff_id, book_id, borrow_date, book_duedate,
return_date
Therefore, there is no partial dependency in this entity’s attributes.
III.c.2.iv. Reserve Entity
The primary key in Reserve entity is reservation_id
The functional dependency in this entity is:
reservation_id – - > book_id, reserve_date
Therefore, there is no partial dependency in this entity’s attributes.
III.c.2.v. Book Entity
The primary key in Book entity is book_id and ISBN
The functional dependency in this entity is:
(book_id, ISBN) – - > title, author, publisher, publication_year, edition, pages,
Genre, Genre_description, Reference_book
ISBN – - > title, author, publisher, publication_year, edition, pages,
Genre, Genre_description, Reference_book
We can see here that there is a partial dependency in this entity. The attributes entity is only partially dependent on the key book_id and ISBN. Actually the attributes is only fully functionally dependent to ISBN. This case happen because the library can have more than one book with the same title, ISBN, etc. but the library have to differentiate this kind of books. That is why we have the book_id as an attribute here since there are more than one book with the same ISBN (In case that these book is the same book with same title, author, edition, etc.) but we can assign each book with a book_id that is unique for the library.
In order to solve this partial dependency, I will introduce a new entity called “Book_info” that contain all the attributes of the Book entity except the book_id attribute. The primary key of this entity is the ISBN attribute. The attributes of Book_info entity and the new attribute of the Book entity is shown in the table below:
| Book_info | |
| Primary Key | ISBN |
| Title | |
| Author | |
| Publisher | |
| Publication_year | |
| Edition | |
| Pages | |
| Genre | |
| Genre_description | |
| Reference_book | |
| Book | |
| Primary Key | book_id |
| ISBN | |
As we can see in the above tables, now the new Book_info entity have all the attributes of the Book entity except the book_id entity. The Book entity now has only two attributes with only one primary key (book_id). The functional dependency of the Book_info entity is as follows:
ISBN – - > title, author, publisher, publication_year, edition, pages,
Genre, Genre_description, Reference_book
On the other hand, the functional dependency of the Book entity is:
book_id – - > ISBN
The Entity Relationship Diagram for our library database system in its 2NF is
2nd Normal Form ERD. Note: - PK means primary key
After we normalized our relationship to its second Normal Form (2NF), now we will do our final normalization process to make it to its third Normal Form (3NF).
We can tell that a relation is in its third Normal Form (3NF) when the relation satisfies three conditions. First, the relation is in second Normal Form (2NF). Second, there is no transitive dependency exist between the entity’s attributes, it means that there should be no attribute that dependent to a non-key attribute. Third, all the attributes in the entity fully dependent on the primary key attribute (Tony Marston, 2004)
Since we have made our library database system’s relation to its second Normal Form (2NF) in the previous section, now we just need to try to find if there is any transitive dependency between the attribute in an entity.
Let’s look at our “Book_info” entity. The functional dependency of this entity is:
ISBN – - > title, author, publisher, publication_year, edition, pages,
Genre, Genre_description, Reference_book
If we observe these attributes of “Book_info” entity, there is a transitive dependency where a non-key attribute that can be used to determine another attribute. These two attributes are Genre and Genre_description.
Genre - – > Genre_description
In order to remove the transitive dependency in the Book_info entity, I will make a new entity called “Genre” that will have two attributes Genre and Genre_description with Genre as its key attribute. We will still have the Genre attribute in the Book_info entity but we will remove Genre_description attribute from the Book_info entity. The following tables show the Genre entity and Book_info entity with its attributes.
| Book_info | |
| Primary Key | ISBN |
| Title | |
| Author | |
| Publisher | |
| Publication_year | |
| Edition | |
| Pages | |
| Genre | |
| Reference_book | |
| Genre | |
| Primary Key | Genre |
| Genre_description | |
After we do this process, now there is no more transitive dependency that exist in our library database system. It also implies that all the attributes in each of entity that we have in this system is fully dependent on the primary key attribute only. This condition means that our library database system is already in its third Normal Form (3NF) and we do not need to do any normalization process anymore.
The Entity Relationship Diagram for our library database system in its 3NF is
3rd Normal Form ERD. Note: - PK means primary key
We have done all the necessary normalization process in the previous section, now we already have the final Entity Relationship Diagram for our library database system. The final ERD is as follows
Final Entity Relationship Diagram for the library database system. Note: - PK means primary key
Finally, I want to write a conclusion for this assignment. In this assignment, I have design a library database system. I start from describing the business operations and activities of the library and listing the business rules of the library. These business rules of the library are important because I have to design the library database system to be able to support the rules.
In the chapter, I start my design with identifying the entities that I need for this library database system. In this process, I discovered three attributes that are Member, Staff, and Book. Then I continue with identifying the attributes for each entity and give relation between the entities. After this process is done, I continue with identifying the primary key attribute for each of the entity.
The next thing that I do is performing the normalization process for the library database system. There are three normalization steps which are transforming to First Normal Form (1NF), Second Normal Form (2NF), and finally to its Third Normal Form (3NF). The Third Normal Form is also resembles the Final Entity Relationship Diagram of the library database system. In this form, all the entity’s attributes is fully dependent on the key attribute. There is no partial dependency, transitive dependency, and repeating groups in this final ERD. Therefore, I can conclude that the design of the library database system has been finished.
CR,Vanslyke, 2008, knol.google.com, “Conceptual Database Design“, Retrieved October 16, 2008, from http://knol.google.com/k/cr-vanslyke/conceptual-database-design/1fwdlprfh17di/2#
Mike, Chapple, 2008, about.com, “Attribute“, Retrieved October 16, 2008, from http://databases.about.com/cs/specificproducts/g/attribute.htm
Mike, Chapple, 2008, about.com, “Primary Key Definition“, Retrieved October 17, 2008, from http://databases.about.com/cs/administration/g/primarykey.htm
“Developing Entity Relationship Diagrams (ERDs)“, 2006, Retrieved October 17, 2008, from http://webfuse.cqu.edu.au/Courses/2006/T2/COIS20025/Assessment/Item_2/Part_A_Resources/erd.pdf
Toni, Marston, 2004, “The Relational Data Model, Normalisation and Effective Database Design“, Retrieved October 18, 2008, from http://www.tonymarston.co.uk/php-mysql/database-design.html
Do you have any comment on this? maybe you have something to ask me or want to discuss with me about this?Or maybe you are IDIC student and taking this module also?
Feel free to use the comment box below (click here if you cannot see the comment box).
Coming next, I will post another IADIC assignment, C2006 Project: System Development
Stay tuned! you can subscribe to my blog’s feed by clicking here so you won’t miss when the new post is published











Thank thomas for publish this website!
This website is really very useful. ^-^
hhhhhhhhhhhhaaaaaaaaaaaaaaaaallllllllllllloooooooooooo!!!
^___________________^
^___________________^
^___________________^
^___________________^
^___________________^
Thanks yaa thomas..
dapat gambaran ni buat bikin diagram nya..
^________^
iya sama2 lius
hello there,
I have an assignment too and i need your help if possible…please add me on msn or write back to me on ma hotmail address which i have provided above. thanx a million.
take care
hey Nims.. what is your assignment about?
ok I got your assignment question:
MAY YOU PLEASE SEND ME A SIMPLE DATABASE.. FOR A LIBRARY WITH LOGIN.. SAME FORM AS ABOVE I WANT TO SEE THE FINISHED PRODUCT AND I WILL TRY TO USE IT FOR MY STUDIES..
THANK YOU..
I AM HOPING TO RECEIVE THIS INFORMATION
Hi Aizel, a database with an application to login is two separated application that linked together. so, what kind of login that you mean?
thank u thomas…i have a lil problem with normalisation, it really confuses me…i saw ur work and it shows all three level of normalisation, i must say its very impressive, i want something similar to what u have for your scenario…looking fwd to your response. tc
maybe I give what are the entities and attributes for each entity.
1. For the entity in ERD
what you think will be the entities in the ERD?
I think it will be:
Customer
Employee
Order
Delivery
Goods – I think goods should be a super entity with some sub entities like Reference Book, Special Edition Book, CD, DVD, and Games
can you make the primary key attribute and attribute for each of these entities?
Or do you want to add the entity?
Thank u thomas, i have similar tables in mind as well, m confused with noramlisation, like how do i start.
I have tables like Customer, Staff, Catalog, Catalog product, Product_Item, Inventory_Item, Order, Order_Item, Order_transaction, Shipment, Shipper
I can come up with primary keys and define their relationship…but just need help with documentation of normalization. I can do an ERD, but can’t put in a form starting from 1stNF, 2ndNf and 3rdNF.
I see, then maybe I help you to explain how to do the normalization.
So, we have some stages of normalization:
UNF – Unnormalized Form
this is a form of a Relation/Entity/Table if it hasn’t satisfy the condition for 1NF (First Normal Form)
1NF – First Normal Form
We can say that a Relation is in 1NF if there is no multivalued attribute in the Relation. Multivalued attribute here means an attribute that may have more than one value.
For Example:
lets say we have “Customer” table that looks like this
Customer(Customer_id, name, address, order_id)
“order_id” in “Customer” table is a multivalued attribute because a customer may has many orders. Because this table has a multivalued attribute, it means that this table is not in 1NF yet.
Now, in order to make this table into 1NF all that we need to do is to remove the multivalued attribute which is the “order_id” from the “Customer” table. We can do this by creating a new table for the “order_id” for example we name it “Order” table with a foreign key to the “Customer” table. So, now we will have:
Customer(Customer_id, name, address)
Order(order_id, Customer_id)
As you can see, now the “Customer” table doesn’t has any multivalued attribute. Now we can say that “Customer Table” is in 1NF.
Do you have any question?
I will continue to explain about how to normalize into 2NF in the next comment post…
Now, I will continue to 2NF (Second Normal Form)
We can say that a Relation/Table is in 2NF if:
1. It is in 1NF (no multivalued attribute)
2. It does not have partial dependency
What is partial dependency?
First of all, partial dependency can only happen if a table has more than one primary key.
Partial dependency is a condition where there is one or more attributes that not functionally dependent on the whole primary key.
To better understand about dependency, look at the sample below:
Example 1 – Functional dependency
Lets say that we have a “Customer” table that looks like this:
Customer(Customer_id, name, address)
As we can see, the primary key of “Customer” table is “Customer_id“.
Now, the functional dependency of “Customer” table will looks like this:
Customer_id –> name, address
It means that attribute “name” and attribute “address” is functionally dependent to the “Customer_id“.
Any question until here?
——————————————————————–
Ok, so thats about dependency. Now, lets take a look on what is “partial dependency”
Example 2 – “Understanding partial dependency”
Lets say we have “Order” table that looks like this:
Order(Order_id, Customer_id, order_date, order_amount, customer_name)
As we can see here, “Order” table has two primary keys which are “Order_id” and “Customer_id“.
Now, lets see the functional dependency of “Order” table:
Order_id, Customer_id –> order_date, order_amount, customer_name
It means, that if we take both the primary keys (Order_id and Customer_id), we can see that all the attributes in “Order” table is functionally dependent on these two primary keys.
Now, let’s see other functional dependency that we can find in this “Order” table:
Order_id –> order_date, order_amount
Here, we can see that actually “order_date” and “order_amount” may have functional dependency to “order_id” only because actually “Customer_id” attribute does not determine an order’s amount or date.
let’s see other functional dependency that we can find in this “Order” table:
Customer_id –> customer_name
Here we can see that “customer_name” attribute is only functionally dependent on “Customer_id” because an “Order_id” does not determine a customer’s name.
This situation is what we call “Partial Dependency”. Because in “Order” table, not all the attribute is actually fully dependent on both the primary keys (Order_id and Customer_id).
Any question until here?
—————————————————–
Now, lets see how to make this “Order” table into 2NF.
We can get rid of the partial dependency in “Order” table by splitting this table into two table:
Order(Order_id, order_amount, order_date)
Customer(Customer_id, customer_name)
Now, we have two table which is “Order” table and “Customer” table. Lets see the Functional Dependency of each table:
Functional Dependency of “Order” table:
Order_id –> order_date, order_amount
We can see that all the attribute is functionally dependent on the whole primary key “Order_id”, therefore no partial dependency in “Order” table.
Functional Dependency in “Customer” table:
Customer_id –> customer_name
We also see here that all the attribute in “Customer” table is functionally dependent to the primary key which is “Customer_id”, So there is no partial dependency in “Customer” table.
Now, we have make “Order” Table into 2NF.
Any question?
I will continue for 3NF in next comment post…
cheers
Ok, now for the 3NF (Third Normal Form)
A Relation or Table is in 3NF if:
1. It satisfy condition for 1NF (No multivalued Attribute)
2. It satisfy condition for 2NF (No Partial Dependency)
3. There is no Transitive Dependency
————————————–
If you understand the concept of “Partial Dependency” that I explained before, then it is easy to understand what is “Transitive Dependency”.
In “Partial Dependency“, there is one or more attributes that depend to only one primary key and not all the primary key of the Relation/Table.
In “Transitive Dependency“, there is one or more attributes that depend to a non-primary key attribute, and not to the primary key of the Relation/Table.
For Example:
Lets say we have a table called “Book” that looks like this:
Book(Book_id, title, publisher, author, author_biography)
The Functional Dependency of this “Book” table are:
Book_id –> title, publisher, author
and
author –> author_biography
We can see here that “author_biography” attribute does not depend on the primary key of “Book” table which is “Book_id“. But “author_biography” attribute depends on “author” attribute which is not a primary key in “Book” table. This is what we call Transitive Dependency.
Any question until here?
—————————————-
Now, lets see how we can solve this transitive dependency problem.
We can get rid of transitive dependency in “Order” table by creating a new table called “Author”, now we have:
Book(Book_id, title, publisher, author)
Author(author, author_biography)
Now, the “Book” table have no “author_biography” attribute, but it still has “author” attribute which act as primary key to link the “Book” table with the “Author” Table.
Any Question until here?
Hope I can help you to understand how to do normalization
thank u thomas, u are a life saver
cheers, will try to do it myself and keep u updated, have a nice day, tc …nims
You are welcome
good luck
hey thomas, have u got any idea of sql and asp.net?
coz my next step is that, craeting table, query, form and reports…
Hi, I know about SQL but I haven’t learn anything about ASP.net yet..
hey thomas, how r you? i have done an ERD but still confused and not sure about it, would u mind looking at it for me. thanks.
i will attch my visio file in ur email account, i cant paste it here.
thanks
nims
Hi Nim, sorry take long to reply, been busy with schoolworks.
I have checked the ERD and reply an e-mail to you..
cheers
Thomas
thanks you so much to publish this website..
you are welcome
Hi, thomas is your name huh? Looks like you are very helpful here, i am adam from India, nice to meet you:)
What are the programmings language you are using? Are you more on server side like database stuff? By any chance, do you know anything about oracle, postgrate etc??
Hi nice to meet you too Nerdie,
For now I am doing PHP and MySQL for server side scripting and database. Sorry I have not learn about oracle or postgrate. How can I help you?
feeling good to find here some help……thanx
you are welcome jagdeep
i have a similar problem in this normalisation field,would u help me?
Yes, how can I help you prakash? what is your problem?
hi,
I have an assignment where I have to make an ERD but I’m not sure about the entities: I know member and movie are entities
Members rent movies from the videoclub. To do so, they need their member id card. The videoclub holds numerous movies which are identified by a bar code. The videoclub has only one copy of movies that are not often rented but holds many copies of movies in high demands. At any time, a member can rent up to 5 movies. The member is required to bring back rented movies within 5 days of the borrowing date. Because the videoclub is opened 7 days a week from 7:00 am to 11:00 pm, there are many clerks who work at the circulation desk. Every time a member wants to rent a movie, he/she needs to find the movie on the shelves, bring it to the circulation desk where the clerk will scan the movie id and the member id card. The clerk gives the movie and the member id card to the client along with a receipt indicating the details of the transaction as well as the return date.
thanks
I think that receipt or Clerks may be entities, they both don’t have any obvious attributes. if not then member and movie are the only entity but then what are the relationships between them?
Hello thomas. I also have an assignment about developing database system for library. So, if you do not mind please help me to do the normalization
hello thomas. i just found out about this blog. n i think its very helpful. i am a nigerian student n i just started my IADIC courses. but im having problem with the project course (C2006). how come u didnt update it? please reply n help. thanks. u can reply the message into my mail. bye
Hi Ugochi, Yes I havent got time to write again. I think I will do a lot of update by February
Hello Thomas, i need help with my ERD assignment. possible to talk to you over msn or smth? regards.
Assume you are working for an Electronic Store in Singapore city, and you have been assigned with task
of developing a conceptual design and to implement it. Your task is to design a database that allows you
to capture the facts described below:
Electronic Store produces three high-cost, low-volume products: P1, P2, and P3. Product P1 is
assembled with components C1 and C2; product P2 is assembled with components C1, C3, and
C4; and product P3 is assembled with components C2 and C3.
Components may be purchased from several vendors, as shown in the table with
Component/Vendor summary given below:
VENDOR COMPONENTS SUPPLIED
V1 C1, C2
V2 C1, C2, C3, C4
V3 C1, C2, C4
Each product has a unique serial number, as does each component. Customers purchase either
component separately or assemble the product by themselves.
To keep track of product performance, careful records are kept to ensure that each product’s
components can be traced to the component supplier.
Products are sold directly to final customers; that is, no wholesale operations are permitted.
The sales records include the customer identification and the product serial number.
For the above given scenario, draw an ER Diagram, using Crow-Foot notation, with the following
requirements:
a. Show the complete set of structural constraints (multiplicity, cardinality, participation);
b. Add the necessary attributes to each entity aside from those mentioned above; kindly distinguish
one attribute to another (primary key, foreign key, additional attributes); and
c. Provide reasonable assumptions to support your diagram. You may refer to the expected
deliverables given in Task 3 and make assumptions accordingly.
How im gonna start about? regards.
Hi Dave,
I am not online often, but I can help you from here.
Hi Dave,
I am not online often. I will try to help you from here..
Yeah. i’ve posted my question. im lost as how many entities shld it be. regards.
Hi Dave,
I think the entities should be:
1. Product
2. Component
3. Vendor
4. Customer
5. Transaction
Or you can leave out the transaction and make it only 4 entities for the ER Diagram
can u send database assignment on airline reservation
Hi Angel,
I dont do any database assignment about airline reservation
but if you have assignment about airline reservation maybe I can help you if you have doubts or questions
maybe you can kindly post the scenario and questions here and indicate which part you need clarifications