SlideShare a Scribd company logo
1 of 37
Database Design
By :
Aulia Mas’adah (12650055)
Sylviana Nur Azizah (12650056)
Kurniawati (12650057)
Aldilla Qurrata A’yun (12650090)
Yuliana Aristantia (12650103)
Entity Relationship – E R
Data Model entity relationship consists of objects
of a group called the entity and the relationship
between entities
Data Model E R is divided into 3 basic concept
that is association association entity, relationship
and the attributes
Entity association and entity
an entity is an object basis or individuals who
represents a real one hardly and can be
distinguished from the objects of objects that
another
entity has a nature, and the value of some of
the is a unique can identify the entity
Entity
as an example : each student in a college was
the entity and NIM uniquely identity can be a
college student
Entity set
 entity Entity a group that has a type that period and is in
scope which forms a complex entity
 as an example a crowd of people who became a
student at a college, can be defined as association
 an entity entity college students. possess attributes .
attributes the properties - qualities or property that entity
. attributes this makes the difference between between
entities that one with another entity
For example entity students have attributes nim,
the name, address and date of birth
Students
nim name
address
Date of birth
Attributes in E-R
characterized in some types:
the attributes simple and the composite
attributes high-single and many
attributes null
attributes derivative
Relationship
 A relation is defined as a set of tuples that have the same attributes.
A tuple usually represents an object and information about that
object. Objects are typically physical objects or concepts. A relation
is usually described as a table, which is organized
into rows and columns. All the data referenced by an attribute are in
the same domain and conform to the same constraints.
Example
MARRIED-MAN IS-MARRIED-TO MARRIED-
WOMAN
• MARRIED-MAN = {Alvi, Rizal, Akhmadi} and
• MARRIED-WOMAN = {Kurnia, Aulia, Meris} and
• Alvi is-married-to Kurnia
• Rizal is-married-to Aulia
• Akhmadi is-married-to Meris
IS-MARRIED-TO =
• { (Alvi, Kurnia), (Rizal, Aulia), (Akhmadi, Meris) }
Representations of a Relationship
Married
Man
Married
Woman
IS
MARRIED
TO
(a) The IS MARRIED TO relationship
Alvi ----------------------------------- Kurnia
Rizal ----------------------------------- Aulia
Akhmadi ----------------------------------- Meris
(b) Some instances of IS MARRIED TO
Cardinality
The degree of relationship (also known as cardinality) is the
number of occurrences in one entity which are associated (or
linked) to the number of occurrences in another.
There are three degrees of relationship, known as:
One-to-one (1:1)
One-to-many (1:M)
Many-to-many (M:N)
One to One
 This is where one occurrence of an entity relates to only one occurrence in
another entity.
 A one-to-one relationship rarely exists in practice, but it can. However, you
may consider combining them into one entity.
 For example, an employee is allocated a company car, which can only be
driven by that employee.
 Therefore, there is a one-to-one relationship between employee and company car.
One to Many
 Is where one occurrence in an entity relates to many occurrences in
another entity.
 For example, taking the employee and department entities shown on
the previous page, an employee works in one department but a
department has many employees.
 Therefore, there is a one-to-many relationship between department
and employee.
Many to Many
 This is where many occurrences in an entity relate to many occurrences in
another entity.
 The normalization process discussed earlier would prevent any such
relationships but the definition is included here for completeness.
 As with one-to-one relationships, many-to-many relationships rarely exist.
Normally they occur because an entity has been missed.
 For example, an employee may work on several projects at the same time
and a project has a team of many employees.
 Therefore, there is a many-to-many relationship between employee and
project.
Optional Relationships
 A relationship may also be optional. Either end of the relationship can include zero occurrences as an
option. This is defined by the business rules of the system being implemented.Taking the three
examples above, the business rules may allow for the following.
 Not all employees are allocated a company car.
 A car is defined as a pool car and not allocated to a specific employee.
 A new department is created but, as yet, there are no employees working within it.
 A new project is defined but as yet the team has not been established.
 A new employee starts within the company but, as yet, is not assigned to a project.
 Taking the first business rule, graphically this can be shown as:
 The circle (O) represents optionality. This will be discussed further later in this section.
Recursive Relationships
 In the examples above, a relationship has always been between occurrences in two
different entities. However, it is possible for the same entity to participate in the
relationship. This is termed a recursive relationship.
 Let us take the example of an employee who is also a manager. But a manager is also
an employee, whose details will be held in the employee entity. To implement this a
foreign key of the employee's manager number would be held in each employee
record.
 Employee entity
 Employee no
 Employee surname
 Employee forename
 Employee DOB
 Employee NI number
 Manager no * (this is the employee no of the employee's manager)
 Graphically, this can be shown as:
Entity Relationship Diagram (ERD)
 Basic ER
18
Sample E-R Diagram
Data Types in The Database
 The data type is always used to determine the data type of a field in
a table. There are ten types of data provided in the database.
 AutoNumber: Displaying numbers automatically starting from the
number 1, followed by the number 2, 3, 4, and seteusnya.
 Currency: Data Memnampung digit, minus sign, and the sign of the
decimal point with 15 digits to the left of the sign of the decimal
point and 4 digits to the right of the decimal point.
 Date / Time: Accommodating the data date, time, and year
starting from 100 up to 9999.
 Hyperlink: Accommodating the data colored text, underlined, and
graphics.
 Lookup Wizard: menampilakan a data type of many
types of data are taken from tables and queries.
 Memo: Accommodating text data (letters, numbers,
punctuation, and symbols chart) as much as 65,535
characters. This type can not be indexed
 Number: Accommodating digit, minus sign, and a
decimal point. This type has 5 bilanngan size and
number of digits.
 OLE object: Holds photo / graphic images, sound and
video recordings, and spreadsheets. The maximum
capacity of this type of data is 1 Gb. This type can not
be indexed.
 Text: Accommodating text data (letters, numbers, and
symbols chart) as many as 255 characters. Standard
characters inserted by 50 characters.
 Yes / No: Holds one of the two available Yes / No,
 True / False, and On / Off.
 The following data types are supported by MySQL are drawn from the MySQL
documentation. Type - This data type is given in the form of ready-written in the
syntax of MySQL syntax, for example, the Create Table.
 In these data types are some of the attributes that have the following meanings:
 M, indicates the maximum character width. The maximum value of M is 255.
 D, indicates the number of decimal places. The maximum value of D is 30, but is
limited by the value of M, which can not be larger than the M-2.
 Marked attributes [and] means their use is optional.
 If the attribute is included ZEROFILL, MySQL will automatically add the
UNSIGNED attribute.
 UNSIGNED is a number without a sign in front of it (eg, a negative sign).
Types of keys in database
1. Primary key
The primary key is an attribute or a set of attributes that are not only minimal uniquely define a specific incident but also
can represent each occurrence of an event.
Field value must be the primary key:
- Unique or may not double
- Not be Null (empty, not known, can not be determined)
- Key is more natural to be a reference
- Database without any data being foreign. Each table can have one or more candidate keys.
- Key may consist of more than one Key field consisting of more than one column is called Composite Key
2. Foreign Key
is a set of attribute or set of attributes as the key link and complete the second table of the relationship (relationship) on the
primary key that shows main key.
If a primary key to the table are connected / other entity, then the existence of a primary key in the entity referred to as a
foreign key.
3. Candidat keys (candidate keys / key candidates)
 is an attribute or a minimum set of attributes that uniquely identifies only for a specific
occurrence of the entity.
 Candidate key must satisfy the following requirements:
 Unique Identifier, for each row / tuple must be unique candidate key can be an identifier.
That is, every non-candidate key attribute is functionally dependent on the candidate.
 Non-Redundancy, no candidate key duplication to be a unique identifier, which can not be
done on the elimination of candidate key which does not damage the unique identifier
properties.
4. Composite Key
 In database design, a composite key is a key that consists of two or more attributes that
uniquely identify an entity occurrence. Each of the key attributes that make up the
compound is a simple key in its own right.
 compositing at least one key attributes that make up the composite is not a simple key.
5. Alternative Key is a candidate key which is not selected as the primary key.
6. Secondary key is an attribute or a combination that is used only for the purpose of data
retrieval.
Normalization
 Database normalization is a systematic approach to
minimize data redundancy in a database so that the
database can work optimally. If you are a database
administrator when there is something in the database
such as performance degradation, you may be asked
whether the database has been normalized?
The purpose of the Database
Normalization
 The goal of database normalization is to eliminate and reduce data
redundancy and the second goal is to ensure data dependencies (data are on
the table right).
 If the data in the database has not been normalized, there will be 3 chances to
be detrimental to the overall system.
 INSERT Anomaly: Situations where not allow to enter multiple types of data
directly in the database.
 Anomaly DELETE: Deletion of data that is not as expected, meaning that the
data should not be deleted may also be deleted.
 UPDATE Anomaly: Situations where the value is converted cause database
inconsistencies, in the sense that the data is not modified in accordance with
the commanded or desired.
Database Normalization
 Database normalization is composed of many forms, in
science there are at least 9 database normalization
existing form is 1NF, 2NF, 3NF, EKNF, BCNF, 4NF, 5NF,
DKNF, and 6NF. However, in practice in the form of
normalization is the industry's most commonly used
about 5 forms.
Normal Form
Data were recorded and entered in a table in raw form is very possible that
the data inconsistencies and anomalies
 Examples of Normal Form
 In this form there are some important characteristic features, the first is
going to happen anomaly in the insert, update, and delete. This causes
some functions in SQL DML can not run properly. For example if you want to
remove the title of the book publisher, the data will be lost as well if you
want to delete the borrower, then the data publishers and books that
should not be deleted will go missing.
First Normal Form (1NF)
 The first normal form or 1NF requires several conditions in
a database, the following is a function of the first normal
form.
 Eliminate duplicate columns from the same table.
 Create separate tables for each group of related data
and identify each row with a unique column (the
primary key).
 Examples of Database Normalization 1NF
 In essence this form of normalization 1NF classifying
multiple data types or groups of similar data so that the
data can be separated so that anomalies can be
overcome.
 Examples of is when we want to delete, update, or add
data to the borrower, then we do not intersect with the
data books or data publisher. So that the inconsistency
of data can start at guard.
Second normal form (2NF)
 Conditions for applying the second form is the
normalization of data has been created in 1NF, the
following are some of the functions of 2NF normalization.
 Removing some subset of the existing data in the table
and put them in a separate table.
 Creating new relationships between tables and the old
table by creating a foreign key.
 There are no attributes in the table are functionally
dependent on the candidate keys of the table.
Examples of database normalization
form 2NF
 Above example, we use a table that is transaction table, in
essence, this is the second bentu should not be any field
related to other functional fields. Examples of Book Title
hanging with id_Buku so in the form 2NF titles can be
removed because it has its own master table.
Third Normal Form (3NF)
Database in the form of 3NF normalization aims to remove
all the attributes or fields that are not associated with the
primary key. Thus there is no transitive dependencies on
each candidate key. Terms of the third normal form or 3NF
is:
 Meet all the requirements of the second normal form.
 Removing columns that are not dependent on the
primary key.
Examples of Forms 3NF Database
Normalization
 Not all cases or tables can be adjusted with the
various forms of this normalization, for example 3NF
we will take the example of table orders.
In the first table above, if all the columns are fully
dependent on the primary key? of course not, it's just that
there is one field that is dependent on the total price and
quantity, can be generated by multiplying the total price
and quantity. Form of 3NF in the table above can be done
by removing the total field.
Database Normalization Function
 In science databases or database, normalization is used to avoid
the occurrence of various data anomalies and consistency of data.
This is a general database functions. In some cases this
normalization is very important to the performance of the database
and ensure that the data in the database is secure and no error
occurs if it gets particularly DML SQL commands that update, insert,
and delete.
 Please note in some cases database normalization sometimes be
transformed to the form denormalisasi, especially for data that has
a large and swollen. Denormalisasi is intended to improve
performance by putting multiple fields into one table so easily in
drag. Denormalisasi is often used to attract large amounts of data
from the database.

More Related Content

What's hot

3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMSkoolkampus
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
Eer >r.model
Eer >r.modelEer >r.model
Eer >r.modellavya3
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Maniguest1e0229a
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Mudasir Qazi
 
Relational Databases 2
Relational Databases 2Relational Databases 2
Relational Databases 2Jason Hando
 
Er model ppt
Er model pptEr model ppt
Er model pptPihu Goel
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelNeil Neelesh
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) modelKumar
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramSiti Ismail
 
Special lecture er diagram
Special lecture er diagramSpecial lecture er diagram
Special lecture er diagramNiaz Ali
 

What's hot (19)

3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMS
 
Entity relationship diagram
Entity relationship diagramEntity relationship diagram
Entity relationship diagram
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
dbms
dbmsdbms
dbms
 
02er
02er02er
02er
 
Eer >r.model
Eer >r.modelEer >r.model
Eer >r.model
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Mani
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
Relational Databases 2
Relational Databases 2Relational Databases 2
Relational Databases 2
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Entity relation(1)
Entity relation(1)Entity relation(1)
Entity relation(1)
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Special lecture er diagram
Special lecture er diagramSpecial lecture er diagram
Special lecture er diagram
 

Similar to Database design

3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdffikadumola
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelA. S. M. Shafi
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal waghharshalkwagh999
 
Chapter-3 Data Modeling Using the Entity-Relationship Model
Chapter-3  Data Modeling Using the Entity-Relationship ModelChapter-3  Data Modeling Using the Entity-Relationship Model
Chapter-3 Data Modeling Using the Entity-Relationship ModelRaj vardhan
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide sharefanta teferi
 
Module 2 dbms.pptx
Module 2 dbms.pptxModule 2 dbms.pptx
Module 2 dbms.pptxVijishK
 
Use analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxUse analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxMwangaPrayGod
 
Chapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxChapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxsantosh96234
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship modelJafar Nesargi
 

Similar to Database design (20)

3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdf
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal wagh
 
Chapter-3 Data Modeling Using the Entity-Relationship Model
Chapter-3  Data Modeling Using the Entity-Relationship ModelChapter-3  Data Modeling Using the Entity-Relationship Model
Chapter-3 Data Modeling Using the Entity-Relationship Model
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Computer sec2-1st term
Computer sec2-1st termComputer sec2-1st term
Computer sec2-1st term
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
Chapter3
Chapter3Chapter3
Chapter3
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
Module 2 dbms.pptx
Module 2 dbms.pptxModule 2 dbms.pptx
Module 2 dbms.pptx
 
Use analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxUse analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptx
 
Chapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxChapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptx
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship model
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
DBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.pptDBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.ppt
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Database design

  • 1. Database Design By : Aulia Mas’adah (12650055) Sylviana Nur Azizah (12650056) Kurniawati (12650057) Aldilla Qurrata A’yun (12650090) Yuliana Aristantia (12650103)
  • 2. Entity Relationship – E R Data Model entity relationship consists of objects of a group called the entity and the relationship between entities Data Model E R is divided into 3 basic concept that is association association entity, relationship and the attributes
  • 3. Entity association and entity an entity is an object basis or individuals who represents a real one hardly and can be distinguished from the objects of objects that another entity has a nature, and the value of some of the is a unique can identify the entity
  • 4. Entity as an example : each student in a college was the entity and NIM uniquely identity can be a college student
  • 5. Entity set  entity Entity a group that has a type that period and is in scope which forms a complex entity  as an example a crowd of people who became a student at a college, can be defined as association  an entity entity college students. possess attributes . attributes the properties - qualities or property that entity . attributes this makes the difference between between entities that one with another entity
  • 6. For example entity students have attributes nim, the name, address and date of birth Students nim name address Date of birth
  • 7. Attributes in E-R characterized in some types: the attributes simple and the composite attributes high-single and many attributes null attributes derivative
  • 8. Relationship  A relation is defined as a set of tuples that have the same attributes. A tuple usually represents an object and information about that object. Objects are typically physical objects or concepts. A relation is usually described as a table, which is organized into rows and columns. All the data referenced by an attribute are in the same domain and conform to the same constraints.
  • 9. Example MARRIED-MAN IS-MARRIED-TO MARRIED- WOMAN • MARRIED-MAN = {Alvi, Rizal, Akhmadi} and • MARRIED-WOMAN = {Kurnia, Aulia, Meris} and • Alvi is-married-to Kurnia • Rizal is-married-to Aulia • Akhmadi is-married-to Meris IS-MARRIED-TO = • { (Alvi, Kurnia), (Rizal, Aulia), (Akhmadi, Meris) }
  • 10. Representations of a Relationship Married Man Married Woman IS MARRIED TO (a) The IS MARRIED TO relationship Alvi ----------------------------------- Kurnia Rizal ----------------------------------- Aulia Akhmadi ----------------------------------- Meris (b) Some instances of IS MARRIED TO
  • 11. Cardinality The degree of relationship (also known as cardinality) is the number of occurrences in one entity which are associated (or linked) to the number of occurrences in another. There are three degrees of relationship, known as: One-to-one (1:1) One-to-many (1:M) Many-to-many (M:N)
  • 12. One to One  This is where one occurrence of an entity relates to only one occurrence in another entity.  A one-to-one relationship rarely exists in practice, but it can. However, you may consider combining them into one entity.  For example, an employee is allocated a company car, which can only be driven by that employee.  Therefore, there is a one-to-one relationship between employee and company car.
  • 13. One to Many  Is where one occurrence in an entity relates to many occurrences in another entity.  For example, taking the employee and department entities shown on the previous page, an employee works in one department but a department has many employees.  Therefore, there is a one-to-many relationship between department and employee.
  • 14. Many to Many  This is where many occurrences in an entity relate to many occurrences in another entity.  The normalization process discussed earlier would prevent any such relationships but the definition is included here for completeness.  As with one-to-one relationships, many-to-many relationships rarely exist. Normally they occur because an entity has been missed.  For example, an employee may work on several projects at the same time and a project has a team of many employees.  Therefore, there is a many-to-many relationship between employee and project.
  • 15. Optional Relationships  A relationship may also be optional. Either end of the relationship can include zero occurrences as an option. This is defined by the business rules of the system being implemented.Taking the three examples above, the business rules may allow for the following.  Not all employees are allocated a company car.  A car is defined as a pool car and not allocated to a specific employee.  A new department is created but, as yet, there are no employees working within it.  A new project is defined but as yet the team has not been established.  A new employee starts within the company but, as yet, is not assigned to a project.  Taking the first business rule, graphically this can be shown as:  The circle (O) represents optionality. This will be discussed further later in this section.
  • 16. Recursive Relationships  In the examples above, a relationship has always been between occurrences in two different entities. However, it is possible for the same entity to participate in the relationship. This is termed a recursive relationship.  Let us take the example of an employee who is also a manager. But a manager is also an employee, whose details will be held in the employee entity. To implement this a foreign key of the employee's manager number would be held in each employee record.  Employee entity  Employee no  Employee surname  Employee forename  Employee DOB  Employee NI number  Manager no * (this is the employee no of the employee's manager)  Graphically, this can be shown as:
  • 17. Entity Relationship Diagram (ERD)  Basic ER
  • 19. Data Types in The Database  The data type is always used to determine the data type of a field in a table. There are ten types of data provided in the database.  AutoNumber: Displaying numbers automatically starting from the number 1, followed by the number 2, 3, 4, and seteusnya.  Currency: Data Memnampung digit, minus sign, and the sign of the decimal point with 15 digits to the left of the sign of the decimal point and 4 digits to the right of the decimal point.  Date / Time: Accommodating the data date, time, and year starting from 100 up to 9999.  Hyperlink: Accommodating the data colored text, underlined, and graphics.
  • 20.  Lookup Wizard: menampilakan a data type of many types of data are taken from tables and queries.  Memo: Accommodating text data (letters, numbers, punctuation, and symbols chart) as much as 65,535 characters. This type can not be indexed  Number: Accommodating digit, minus sign, and a decimal point. This type has 5 bilanngan size and number of digits.  OLE object: Holds photo / graphic images, sound and video recordings, and spreadsheets. The maximum capacity of this type of data is 1 Gb. This type can not be indexed.
  • 21.  Text: Accommodating text data (letters, numbers, and symbols chart) as many as 255 characters. Standard characters inserted by 50 characters.  Yes / No: Holds one of the two available Yes / No,  True / False, and On / Off.
  • 22.  The following data types are supported by MySQL are drawn from the MySQL documentation. Type - This data type is given in the form of ready-written in the syntax of MySQL syntax, for example, the Create Table.  In these data types are some of the attributes that have the following meanings:  M, indicates the maximum character width. The maximum value of M is 255.  D, indicates the number of decimal places. The maximum value of D is 30, but is limited by the value of M, which can not be larger than the M-2.  Marked attributes [and] means their use is optional.  If the attribute is included ZEROFILL, MySQL will automatically add the UNSIGNED attribute.  UNSIGNED is a number without a sign in front of it (eg, a negative sign).
  • 23. Types of keys in database 1. Primary key The primary key is an attribute or a set of attributes that are not only minimal uniquely define a specific incident but also can represent each occurrence of an event. Field value must be the primary key: - Unique or may not double - Not be Null (empty, not known, can not be determined) - Key is more natural to be a reference - Database without any data being foreign. Each table can have one or more candidate keys. - Key may consist of more than one Key field consisting of more than one column is called Composite Key 2. Foreign Key is a set of attribute or set of attributes as the key link and complete the second table of the relationship (relationship) on the primary key that shows main key. If a primary key to the table are connected / other entity, then the existence of a primary key in the entity referred to as a foreign key.
  • 24. 3. Candidat keys (candidate keys / key candidates)  is an attribute or a minimum set of attributes that uniquely identifies only for a specific occurrence of the entity.  Candidate key must satisfy the following requirements:  Unique Identifier, for each row / tuple must be unique candidate key can be an identifier. That is, every non-candidate key attribute is functionally dependent on the candidate.  Non-Redundancy, no candidate key duplication to be a unique identifier, which can not be done on the elimination of candidate key which does not damage the unique identifier properties. 4. Composite Key  In database design, a composite key is a key that consists of two or more attributes that uniquely identify an entity occurrence. Each of the key attributes that make up the compound is a simple key in its own right.  compositing at least one key attributes that make up the composite is not a simple key. 5. Alternative Key is a candidate key which is not selected as the primary key. 6. Secondary key is an attribute or a combination that is used only for the purpose of data retrieval.
  • 25. Normalization  Database normalization is a systematic approach to minimize data redundancy in a database so that the database can work optimally. If you are a database administrator when there is something in the database such as performance degradation, you may be asked whether the database has been normalized?
  • 26. The purpose of the Database Normalization  The goal of database normalization is to eliminate and reduce data redundancy and the second goal is to ensure data dependencies (data are on the table right).  If the data in the database has not been normalized, there will be 3 chances to be detrimental to the overall system.  INSERT Anomaly: Situations where not allow to enter multiple types of data directly in the database.  Anomaly DELETE: Deletion of data that is not as expected, meaning that the data should not be deleted may also be deleted.  UPDATE Anomaly: Situations where the value is converted cause database inconsistencies, in the sense that the data is not modified in accordance with the commanded or desired.
  • 27. Database Normalization  Database normalization is composed of many forms, in science there are at least 9 database normalization existing form is 1NF, 2NF, 3NF, EKNF, BCNF, 4NF, 5NF, DKNF, and 6NF. However, in practice in the form of normalization is the industry's most commonly used about 5 forms.
  • 28. Normal Form Data were recorded and entered in a table in raw form is very possible that the data inconsistencies and anomalies  Examples of Normal Form  In this form there are some important characteristic features, the first is going to happen anomaly in the insert, update, and delete. This causes some functions in SQL DML can not run properly. For example if you want to remove the title of the book publisher, the data will be lost as well if you want to delete the borrower, then the data publishers and books that should not be deleted will go missing.
  • 29. First Normal Form (1NF)  The first normal form or 1NF requires several conditions in a database, the following is a function of the first normal form.  Eliminate duplicate columns from the same table.  Create separate tables for each group of related data and identify each row with a unique column (the primary key).
  • 30.  Examples of Database Normalization 1NF
  • 31.  In essence this form of normalization 1NF classifying multiple data types or groups of similar data so that the data can be separated so that anomalies can be overcome.  Examples of is when we want to delete, update, or add data to the borrower, then we do not intersect with the data books or data publisher. So that the inconsistency of data can start at guard.
  • 32. Second normal form (2NF)  Conditions for applying the second form is the normalization of data has been created in 1NF, the following are some of the functions of 2NF normalization.  Removing some subset of the existing data in the table and put them in a separate table.  Creating new relationships between tables and the old table by creating a foreign key.  There are no attributes in the table are functionally dependent on the candidate keys of the table.
  • 33. Examples of database normalization form 2NF  Above example, we use a table that is transaction table, in essence, this is the second bentu should not be any field related to other functional fields. Examples of Book Title hanging with id_Buku so in the form 2NF titles can be removed because it has its own master table.
  • 34. Third Normal Form (3NF) Database in the form of 3NF normalization aims to remove all the attributes or fields that are not associated with the primary key. Thus there is no transitive dependencies on each candidate key. Terms of the third normal form or 3NF is:  Meet all the requirements of the second normal form.  Removing columns that are not dependent on the primary key.
  • 35. Examples of Forms 3NF Database Normalization  Not all cases or tables can be adjusted with the various forms of this normalization, for example 3NF we will take the example of table orders.
  • 36. In the first table above, if all the columns are fully dependent on the primary key? of course not, it's just that there is one field that is dependent on the total price and quantity, can be generated by multiplying the total price and quantity. Form of 3NF in the table above can be done by removing the total field.
  • 37. Database Normalization Function  In science databases or database, normalization is used to avoid the occurrence of various data anomalies and consistency of data. This is a general database functions. In some cases this normalization is very important to the performance of the database and ensure that the data in the database is secure and no error occurs if it gets particularly DML SQL commands that update, insert, and delete.  Please note in some cases database normalization sometimes be transformed to the form denormalisasi, especially for data that has a large and swollen. Denormalisasi is intended to improve performance by putting multiple fields into one table so easily in drag. Denormalisasi is often used to attract large amounts of data from the database.