SlideShare a Scribd company logo
1 of 40
Database
Design and
Maintenance
Review
• Proper database design ensures that the data is
represented properly, tables are joined correctly, and
that data can be easily and accurately retrieved.
Relational Database Terms
• Relation = Table
• Tuple = Row
• Attribute = Field
Relational Database
Characteristics
• No two tuples can be exactly the same.
• The order of tuples has no significance.
• Each attribute must describe the relation, and have a unique
name.
• Each attribute can have only one value in a tuple.
• An attribute must have the same set of possible values
(domain) in all tuples.
Building a
Relational Database
• Designing tables
• Creating tables
• Joining tables
• Designing and creating other
objects
Recognizing Table Types
• Master tables – contain data about people and things.
• Lookup tables – contain data about groups or categories of
information.
• Bridge or Transaction tables – contain data about transactions
and events. Often used to simplify many-to-many joins.
Identifying a Primary Key
• One or more fields that uniquely identify each
record
• Primary key field must not be blank in any record.
Data Dependency
• Functional dependency - when any attribute determines the
value of another attribute.
• Transitive dependency – when a non-key attribute determines
the value of another attribute.
• Partial dependency – when only one field in a multiple-field
primary key determines the value of another attribute.
Well-Structured Relations
What constitutes a well-structured relation? Intuitively, a
well-structured relation contains minimal redundancy and
allows users to insert, modify, and delete rows in a table
without errors or inconsistencies.
EmpID Name Dept Salary
230 Pillsbury Marketing 58,000
241 Marshall Finance 68,400
277 Marco Accounting 66,000
279 Gunston Marketing 42,400
290 Jaffe Planning 49,000
EMPLOYEE1 Table
Well-Structured Relations
EMPLOYEE1 is a well-structured relation. Each row of the
table contains data describing one employee, and any
modification of an employee’s data (such as a change in
salary) is confined to one row in the table.
EmpID Name Dept Salary
230 Pillsbury Marketing 58,000
241 Marshall Finance 68,400
277 Marco Accounting 66,000
279 Gunston Marketing 42,400
290 Jaffe Planning 49,000
EMPLOYEE1 Table
Well-Structured Relations
In contrast, EMPLOYEE2 is not a well-structured relation. Notice
the redundancy. For example, values for EmpID, Name, Dept, and
Salary appear in two separate rows for employees 241 and 290.
EmpID Name Dept Salary Course Date
230 Pillsbury Marketing 58,000 C++ 2/12/06
241 Marshall Finance 68,400 SPSS 5/30/07
241 Marshall Finance 68,400 Web Design 11/2/08
277 Marco Accounting 66,000 C# 12/8/07
279 Gunston Marketing 42,400 Java 9/10/06
290 Jaffe Planning 49,000 Tax Acct 4/22/06
290 Jaffe Planning 49,000 Bus Adm 6/6/08
EMPLOYEE2 Table
Data Anomalies
There are three types of data anomalies:
• Insertion anomaly – Suppose we need to add a new employee to
EMPLOYEE2. Since the primary key is (EmpID, Course), to insert a row
both EmpID and Course must be supplied. This is an anomaly, because the
user should be able to enter employee data without supplying Course data.
• Deletion anomaly – Suppose that the data for employee 241 are deleted.
This will result in losing information that this employee completed a course
(SPSS) on 5/30/07.
• Modification anomaly – Suppose that employee 290 gets a salary increase.
We must record the increase in each of the rows for that employee;
otherwise the data will be inconsistent.
Redundancies in a table may result in errors or inconsistencies (called
anomalies) when a user attempts to update the data in the table.
The problem with relation EMPLOYEE2 is that it contains data about two
entities: EMPLOYEE and COURSE. We will use normalization techniques to split
EMPLOYEE2 into two relations, one for employee data and one for course data.
Normalizing Tables
On the previous four slides we presented an intuitive discussion of well-
structured relations. We need a more formal procedure for designing
them. Normalization is the process of successively reducing
relations with anomalies to produce smaller, well-structured relations.
Some of the goals are:
 Minimize data redundancy, thereby avoiding anomalies and
conserving storage space.
 Simplify the enforcement of referential integrity constraints.
 Make it easier to maintain data (insert, delete, update).
 Provide a better design that is an improved representation of the real
world and a stronger basis for future growth.
First Normal Form
• All fields describe the entity represented by the
table.
• All fields contain simplest possible values.
• No multivalued attributes (also called repeating
groups).
Home Town
Chicago, IL
NOT
City State
Chicago IL
1st NORMAL
Not 1NF
EmpID Dept CourseName DateCompleted
203 Finance Tax Accounting 6/22/07
421 Info Systems Java
Database Mgt
10/7/07
6/4/06
666 Marketing
Another
multivalued
attribute
A multivalued
attribute
1NF - Eliminating multivalued
attributes
EmpID Dept CourseName DateCompleted
203 Finance Tax Accounting 6/22/07
421 Info Systems Java 10/7/07
421 Info Systems Database Mgt 6/4/06
666 Marketing
This new table does have only single-valued attributes
and so satisfies 1NF. However, as we saw, the table still
has some undesirable properties.
Second Normal Form
• Table is in First Normal Form.
• No partial dependencies exist. (No nonkey fields
are determined by only part of a multiple-field
primary key, i.e., nonkeys are identified by the
whole primary key)
*Primary key
NOT
2nd NORMAL
Course#* Grade
CIS 101 B
Student ID*
12345
Course#* Name
CIS 101 Higgins
Student ID*
12345
Determines
Determines
Third Normal Form
• Table is in Second Normal Form.
• No transitive dependencies (no nonkey fields are
determined by other nonkey fields, i.e., nonkeys are
identified by only the primary key).
Course# * Textbook
CIS 101 Intro to CIS
Credits
3
NOT
3rd NORMAL
*Primary key
Course# * Textbook
CIS 101 Intro to CIS
Book Price
$45.99
Determines Determines
Fourth and Fifth Normal Form
• Fourth Normal Form – Table is 3NF and has at most
one multivalued dependency. Can produce records
with many blank values.
• Fifth Normal Form – the table cannot be split
into further tables.
Advanced Field Properties
• Lookup fields
• Multiple-field primary
keys
• Indexes
Lookup Field
• Looks up a value in a joined table.
• Specify “Lookup wizard” in Data Type list.
• Creates an editable query.
Using a Lookup Field
Order Customer ID
1008 S349
Customer ID Name
S349 Smith,Ben
Orders Customers
Looks up Name
in Customer table
Looks up data values from another table
(or you can create your own list).
S349
Smith,Ben
Multiple-field Primary Keys
• Also called compound keys or composite keys
• A value in one field in the key can be repeated in
multiple records, but not in all fields of the primary
key.
Course# * Grade
CIS 101 A
Student ID*
12345
*Primary key
CIS 200 B
12345
Index
• Field property that increases
search speed.
• Speeds up sorting and searching
in Datasheet view and all database
objects.
Joining Tables
• One-to-Many join is the most common.
• Other join types:
– One-to-One
– Many-to-Many
Table 2
Table 1
One to Many
Rec. 1
Rec. 1 Rec. 2
One to One
Rec. 1
Rec. 1
Many to Many
Rec. 1
Rec. 1 Rec. 2
Rec. 2
Join Types
• Inner Join
• Left Outer Join
• Right Outer Join
Join types are discussed in the slides to follow,
but also see the discussion at Join-queries.htm.
The default type - includes records with
corresponding values in both tables.
LASTNAME FIRSTNAME DEPARTMENT
Gray Eric CIS
Gray Nadine HRS
Cedarman YvonneHRS
Malderer Kevin HRS
Nale Rusty
DEPARTMENT CODE NAME
CIS Computer Information Systems
HRS Human Resources
WHS Warehouse
Only red
records are
included in join.
No department for Nale
No Warehouse employees
Inner Join
1

CIS
HRS
HRS
HRS
WHS
Includes all records from One table and
corresponding records from Many table
Left Outer Join
LASTNAME FIRSTNAME DEPARTMENT
Gray Eric CIS
Gray Nadine HRS
Cedarman YvonneHRS
Malderer Kevin HRS
Nale Rusty
DEPARTMENT CODE NAME
CIS Computer Information Systems
HRS Human Resources
WHS Warehouse
Rusty Nale not
included – no
department
assigned.
1

How to Change the Join Properties in Query Design View
Double-click on the join line that connects the tables.
Click the bullet next to the join property desired.
For example, in the 240students.mdb database, suppose we
want all students and the pets they own. All students should be
listed regardless of whether they own a pet or not.
This is perfect for a Left Outer Join, because it will select a
student from tblStudents (the “One” table) even if there isn’t a
match (between ID and OwnerID) in tblPets (the “Many” table).
Here’s the SQL and the result of running the query
• The result of running this query (in the
240students.mdb database) Left-Join.htm.
SELECT ID, FirstName, Name, Breed
FROM tblStudents LEFT JOIN tblPets
ON tblStudents.ID = tblPets.OwnerID
LASTNAME FIRSTNAME DEPARTMENT
Gray Eric CIS
Gray Nadine HRS
Cedarman YvonneHRS
Malderer Kevin HRS
Nale Rusty
DEPARTMENT CODE NAME
CIS Computer Information Systems
HRS Human Resources
WHS Warehouse
Warehouse
dept. not
included – no
employees
assigned.
Includes all records from Many table and
corresponding records from One table.
Right Outer Join
1

Join Types
Joins displayed as Venn Diagrams
A
B
Inner Join
A B
U
A
B
Left Outer Join
A is “one” table
A and B are tables
Green striped area is join dynaset.
A
B
Right Outer Join
B is “many” table
Join Types
Selected by double clicking on join line between two
tables in Relationship window, and clicking Join Type
button.
Referential Integrity
• Referential integrity keeps the relationships between
tables valid.
• All foreign keys have values that correspond to
records in the referenced table
• Maintain referential integrity by:
– Updating and deleting records when matching
records in a joined table are updated and deleted.
– Eliminating unmatched and duplicated records in
joined tables.
Enforcing Referential
Integrity
• Normalize tables
• Set field properties
• Use lookup fields
• Select specific join type settings
• Create and run Find Duplicate and Find Unmatched
queries
Find Duplicate Records Query
• Locates records with duplicate values in Many
table.
One table Many table
Duplicates
Find Unmatched
Records Query
Locates records in Many table not associated with
record in One table
One table Many table
No match
Maintaining Databases
• Older versions of Access can be converted to newer versions, and
vice versa.
• Databases can be compacted and repaired using the Tools,
Database Utilities command.
• Databases can be split into two databases: data and objects
(back and front end).
• Databases can be documented using the Tools, Analyze,
Documenter command.
• Database performance can be analyzed using the Tools, Analyze,
Performance command.
Object Groups
• Named set of shortcuts that point to database
objects
• Grouped objects are listed together in a single
window.
Modifying Access
Environment
• Tools, Options command allows
changes to the behavior of Access.
• Access standard toolbars can be
modified.

More Related Content

Similar to Topics-Ch4Ch5.ppt

AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxAB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxbartholomeocoombs
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems incMuthu Natarajan
 
Intro to Data warehousing lecture 10
Intro to Data warehousing   lecture 10Intro to Data warehousing   lecture 10
Intro to Data warehousing lecture 10AnwarrChaudary
 
How Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill SetsHow Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill SetsChad Petrovay
 
Creating and editing a database
Creating and editing a databaseCreating and editing a database
Creating and editing a databasecrystalpullen
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal waghharshalkwagh999
 
SQL intro.pptx
SQL intro.pptxSQL intro.pptx
SQL intro.pptxRobNieves1
 
MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra QUONTRASOLUTIONS
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management SystemMian Abdul Raheem
 
DB Design.ppt
DB Design.pptDB Design.ppt
DB Design.pptJakeParas
 
Relational database intro for marketers
Relational database intro for marketersRelational database intro for marketers
Relational database intro for marketersSteve Finlay
 

Similar to Topics-Ch4Ch5.ppt (20)

RDMS AND SQL
RDMS AND SQLRDMS AND SQL
RDMS AND SQL
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxAB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
 
Intro to Data warehousing lecture 10
Intro to Data warehousing   lecture 10Intro to Data warehousing   lecture 10
Intro to Data warehousing lecture 10
 
How Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill SetsHow Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill Sets
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 
SQL_Part1
SQL_Part1SQL_Part1
SQL_Part1
 
Creating and editing a database
Creating and editing a databaseCreating and editing a database
Creating and editing a database
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal wagh
 
SQL intro.pptx
SQL intro.pptxSQL intro.pptx
SQL intro.pptx
 
MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Sql Lab 4 Essay
Sql Lab 4 EssaySql Lab 4 Essay
Sql Lab 4 Essay
 
week3.ppt
week3.pptweek3.ppt
week3.ppt
 
DB Design.ppt
DB Design.pptDB Design.ppt
DB Design.ppt
 
Fg d
Fg dFg d
Fg d
 
Relational database intro for marketers
Relational database intro for marketersRelational database intro for marketers
Relational database intro for marketers
 
DATABASE-1.pptx
DATABASE-1.pptxDATABASE-1.pptx
DATABASE-1.pptx
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 

More from ahmadfaisal744721

Introduction+to+AngularJS+with+logo+from+digital+ocean.pdf
Introduction+to+AngularJS+with+logo+from+digital+ocean.pdfIntroduction+to+AngularJS+with+logo+from+digital+ocean.pdf
Introduction+to+AngularJS+with+logo+from+digital+ocean.pdfahmadfaisal744721
 
db design and maintenance part 1.pptx
db design and maintenance part 1.pptxdb design and maintenance part 1.pptx
db design and maintenance part 1.pptxahmadfaisal744721
 
Chapter 4v4 Network protocols and standards 2.pptx
Chapter 4v4  Network protocols and standards 2.pptxChapter 4v4  Network protocols and standards 2.pptx
Chapter 4v4 Network protocols and standards 2.pptxahmadfaisal744721
 
Chapter 4v4 Network protocols and standards 1.pptx
Chapter 4v4  Network protocols and standards 1.pptxChapter 4v4  Network protocols and standards 1.pptx
Chapter 4v4 Network protocols and standards 1.pptxahmadfaisal744721
 
Chapter 3v3 Mobile communication systems.pptx
Chapter 3v3 Mobile communication systems.pptxChapter 3v3 Mobile communication systems.pptx
Chapter 3v3 Mobile communication systems.pptxahmadfaisal744721
 
Chapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptxChapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptxahmadfaisal744721
 
Chapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptxChapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptxahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 9.ppt
Sec.0a--Intro to pervasive computing 9.pptSec.0a--Intro to pervasive computing 9.ppt
Sec.0a--Intro to pervasive computing 9.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 8.ppt
Sec.0a--Intro to pervasive computing 8.pptSec.0a--Intro to pervasive computing 8.ppt
Sec.0a--Intro to pervasive computing 8.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 7.ppt
Sec.0a--Intro to pervasive computing 7.pptSec.0a--Intro to pervasive computing 7.ppt
Sec.0a--Intro to pervasive computing 7.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 6.ppt
Sec.0a--Intro to pervasive computing 6.pptSec.0a--Intro to pervasive computing 6.ppt
Sec.0a--Intro to pervasive computing 6.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 5.ppt
Sec.0a--Intro to pervasive computing 5.pptSec.0a--Intro to pervasive computing 5.ppt
Sec.0a--Intro to pervasive computing 5.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 4.ppt
Sec.0a--Intro to pervasive computing 4.pptSec.0a--Intro to pervasive computing 4.ppt
Sec.0a--Intro to pervasive computing 4.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 3.ppt
Sec.0a--Intro to pervasive computing 3.pptSec.0a--Intro to pervasive computing 3.ppt
Sec.0a--Intro to pervasive computing 3.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 2.ppt
Sec.0a--Intro to pervasive computing 2.pptSec.0a--Intro to pervasive computing 2.ppt
Sec.0a--Intro to pervasive computing 2.pptahmadfaisal744721
 
Sec.0a--Intro to pervasive computing 1.ppt
Sec.0a--Intro to pervasive computing 1.pptSec.0a--Intro to pervasive computing 1.ppt
Sec.0a--Intro to pervasive computing 1.pptahmadfaisal744721
 

More from ahmadfaisal744721 (20)

Introduction+to+AngularJS+with+logo+from+digital+ocean.pdf
Introduction+to+AngularJS+with+logo+from+digital+ocean.pdfIntroduction+to+AngularJS+with+logo+from+digital+ocean.pdf
Introduction+to+AngularJS+with+logo+from+digital+ocean.pdf
 
Intoduction to Graph.pptx
Intoduction to Graph.pptxIntoduction to Graph.pptx
Intoduction to Graph.pptx
 
Introduction to Android.ppt
Introduction to Android.pptIntroduction to Android.ppt
Introduction to Android.ppt
 
db design and maintenance part 1.pptx
db design and maintenance part 1.pptxdb design and maintenance part 1.pptx
db design and maintenance part 1.pptx
 
Chapter 4v4 Network protocols and standards 2.pptx
Chapter 4v4  Network protocols and standards 2.pptxChapter 4v4  Network protocols and standards 2.pptx
Chapter 4v4 Network protocols and standards 2.pptx
 
Chapter 4v4 Network protocols and standards 1.pptx
Chapter 4v4  Network protocols and standards 1.pptxChapter 4v4  Network protocols and standards 1.pptx
Chapter 4v4 Network protocols and standards 1.pptx
 
Chapter 3v3 Mobile communication systems.pptx
Chapter 3v3 Mobile communication systems.pptxChapter 3v3 Mobile communication systems.pptx
Chapter 3v3 Mobile communication systems.pptx
 
Chapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptxChapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 2.pptx
 
Chapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptxChapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptx
Chapter 2v4 Pervasive Computing systems, design and infrastructure 1.pptx
 
Sec.0a--Intro to pervasive computing 9.ppt
Sec.0a--Intro to pervasive computing 9.pptSec.0a--Intro to pervasive computing 9.ppt
Sec.0a--Intro to pervasive computing 9.ppt
 
Sec.0a--Intro to pervasive computing 8.ppt
Sec.0a--Intro to pervasive computing 8.pptSec.0a--Intro to pervasive computing 8.ppt
Sec.0a--Intro to pervasive computing 8.ppt
 
Sec.0a--Intro to pervasive computing 7.ppt
Sec.0a--Intro to pervasive computing 7.pptSec.0a--Intro to pervasive computing 7.ppt
Sec.0a--Intro to pervasive computing 7.ppt
 
Sec.0a--Intro to pervasive computing 6.ppt
Sec.0a--Intro to pervasive computing 6.pptSec.0a--Intro to pervasive computing 6.ppt
Sec.0a--Intro to pervasive computing 6.ppt
 
Sec.0a--Intro to pervasive computing 5.ppt
Sec.0a--Intro to pervasive computing 5.pptSec.0a--Intro to pervasive computing 5.ppt
Sec.0a--Intro to pervasive computing 5.ppt
 
Sec.0a--Intro to pervasive computing 4.ppt
Sec.0a--Intro to pervasive computing 4.pptSec.0a--Intro to pervasive computing 4.ppt
Sec.0a--Intro to pervasive computing 4.ppt
 
Sec.0a--Intro to pervasive computing 3.ppt
Sec.0a--Intro to pervasive computing 3.pptSec.0a--Intro to pervasive computing 3.ppt
Sec.0a--Intro to pervasive computing 3.ppt
 
Sec.0a--Intro to pervasive computing 2.ppt
Sec.0a--Intro to pervasive computing 2.pptSec.0a--Intro to pervasive computing 2.ppt
Sec.0a--Intro to pervasive computing 2.ppt
 
Sec.0a--Intro to pervasive computing 1.ppt
Sec.0a--Intro to pervasive computing 1.pptSec.0a--Intro to pervasive computing 1.ppt
Sec.0a--Intro to pervasive computing 1.ppt
 
write no image.pptx
write no image.pptxwrite no image.pptx
write no image.pptx
 
Topics-Ch4Ch5.ppt
Topics-Ch4Ch5.pptTopics-Ch4Ch5.ppt
Topics-Ch4Ch5.ppt
 

Recently uploaded

RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad EscortsCall girls in Ahmedabad High profile
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 

Recently uploaded (20)

RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 

Topics-Ch4Ch5.ppt

  • 2. Review • Proper database design ensures that the data is represented properly, tables are joined correctly, and that data can be easily and accurately retrieved.
  • 3. Relational Database Terms • Relation = Table • Tuple = Row • Attribute = Field
  • 4. Relational Database Characteristics • No two tuples can be exactly the same. • The order of tuples has no significance. • Each attribute must describe the relation, and have a unique name. • Each attribute can have only one value in a tuple. • An attribute must have the same set of possible values (domain) in all tuples.
  • 5. Building a Relational Database • Designing tables • Creating tables • Joining tables • Designing and creating other objects
  • 6. Recognizing Table Types • Master tables – contain data about people and things. • Lookup tables – contain data about groups or categories of information. • Bridge or Transaction tables – contain data about transactions and events. Often used to simplify many-to-many joins.
  • 7. Identifying a Primary Key • One or more fields that uniquely identify each record • Primary key field must not be blank in any record.
  • 8. Data Dependency • Functional dependency - when any attribute determines the value of another attribute. • Transitive dependency – when a non-key attribute determines the value of another attribute. • Partial dependency – when only one field in a multiple-field primary key determines the value of another attribute.
  • 9. Well-Structured Relations What constitutes a well-structured relation? Intuitively, a well-structured relation contains minimal redundancy and allows users to insert, modify, and delete rows in a table without errors or inconsistencies. EmpID Name Dept Salary 230 Pillsbury Marketing 58,000 241 Marshall Finance 68,400 277 Marco Accounting 66,000 279 Gunston Marketing 42,400 290 Jaffe Planning 49,000 EMPLOYEE1 Table
  • 10. Well-Structured Relations EMPLOYEE1 is a well-structured relation. Each row of the table contains data describing one employee, and any modification of an employee’s data (such as a change in salary) is confined to one row in the table. EmpID Name Dept Salary 230 Pillsbury Marketing 58,000 241 Marshall Finance 68,400 277 Marco Accounting 66,000 279 Gunston Marketing 42,400 290 Jaffe Planning 49,000 EMPLOYEE1 Table
  • 11. Well-Structured Relations In contrast, EMPLOYEE2 is not a well-structured relation. Notice the redundancy. For example, values for EmpID, Name, Dept, and Salary appear in two separate rows for employees 241 and 290. EmpID Name Dept Salary Course Date 230 Pillsbury Marketing 58,000 C++ 2/12/06 241 Marshall Finance 68,400 SPSS 5/30/07 241 Marshall Finance 68,400 Web Design 11/2/08 277 Marco Accounting 66,000 C# 12/8/07 279 Gunston Marketing 42,400 Java 9/10/06 290 Jaffe Planning 49,000 Tax Acct 4/22/06 290 Jaffe Planning 49,000 Bus Adm 6/6/08 EMPLOYEE2 Table
  • 12. Data Anomalies There are three types of data anomalies: • Insertion anomaly – Suppose we need to add a new employee to EMPLOYEE2. Since the primary key is (EmpID, Course), to insert a row both EmpID and Course must be supplied. This is an anomaly, because the user should be able to enter employee data without supplying Course data. • Deletion anomaly – Suppose that the data for employee 241 are deleted. This will result in losing information that this employee completed a course (SPSS) on 5/30/07. • Modification anomaly – Suppose that employee 290 gets a salary increase. We must record the increase in each of the rows for that employee; otherwise the data will be inconsistent. Redundancies in a table may result in errors or inconsistencies (called anomalies) when a user attempts to update the data in the table. The problem with relation EMPLOYEE2 is that it contains data about two entities: EMPLOYEE and COURSE. We will use normalization techniques to split EMPLOYEE2 into two relations, one for employee data and one for course data.
  • 13. Normalizing Tables On the previous four slides we presented an intuitive discussion of well- structured relations. We need a more formal procedure for designing them. Normalization is the process of successively reducing relations with anomalies to produce smaller, well-structured relations. Some of the goals are:  Minimize data redundancy, thereby avoiding anomalies and conserving storage space.  Simplify the enforcement of referential integrity constraints.  Make it easier to maintain data (insert, delete, update).  Provide a better design that is an improved representation of the real world and a stronger basis for future growth.
  • 14. First Normal Form • All fields describe the entity represented by the table. • All fields contain simplest possible values. • No multivalued attributes (also called repeating groups). Home Town Chicago, IL NOT City State Chicago IL 1st NORMAL
  • 15. Not 1NF EmpID Dept CourseName DateCompleted 203 Finance Tax Accounting 6/22/07 421 Info Systems Java Database Mgt 10/7/07 6/4/06 666 Marketing Another multivalued attribute A multivalued attribute
  • 16. 1NF - Eliminating multivalued attributes EmpID Dept CourseName DateCompleted 203 Finance Tax Accounting 6/22/07 421 Info Systems Java 10/7/07 421 Info Systems Database Mgt 6/4/06 666 Marketing This new table does have only single-valued attributes and so satisfies 1NF. However, as we saw, the table still has some undesirable properties.
  • 17. Second Normal Form • Table is in First Normal Form. • No partial dependencies exist. (No nonkey fields are determined by only part of a multiple-field primary key, i.e., nonkeys are identified by the whole primary key) *Primary key NOT 2nd NORMAL Course#* Grade CIS 101 B Student ID* 12345 Course#* Name CIS 101 Higgins Student ID* 12345 Determines Determines
  • 18. Third Normal Form • Table is in Second Normal Form. • No transitive dependencies (no nonkey fields are determined by other nonkey fields, i.e., nonkeys are identified by only the primary key). Course# * Textbook CIS 101 Intro to CIS Credits 3 NOT 3rd NORMAL *Primary key Course# * Textbook CIS 101 Intro to CIS Book Price $45.99 Determines Determines
  • 19. Fourth and Fifth Normal Form • Fourth Normal Form – Table is 3NF and has at most one multivalued dependency. Can produce records with many blank values. • Fifth Normal Form – the table cannot be split into further tables.
  • 20. Advanced Field Properties • Lookup fields • Multiple-field primary keys • Indexes
  • 21. Lookup Field • Looks up a value in a joined table. • Specify “Lookup wizard” in Data Type list. • Creates an editable query.
  • 22. Using a Lookup Field Order Customer ID 1008 S349 Customer ID Name S349 Smith,Ben Orders Customers Looks up Name in Customer table Looks up data values from another table (or you can create your own list). S349 Smith,Ben
  • 23. Multiple-field Primary Keys • Also called compound keys or composite keys • A value in one field in the key can be repeated in multiple records, but not in all fields of the primary key. Course# * Grade CIS 101 A Student ID* 12345 *Primary key CIS 200 B 12345
  • 24. Index • Field property that increases search speed. • Speeds up sorting and searching in Datasheet view and all database objects.
  • 25. Joining Tables • One-to-Many join is the most common. • Other join types: – One-to-One – Many-to-Many Table 2 Table 1 One to Many Rec. 1 Rec. 1 Rec. 2 One to One Rec. 1 Rec. 1 Many to Many Rec. 1 Rec. 1 Rec. 2 Rec. 2
  • 26. Join Types • Inner Join • Left Outer Join • Right Outer Join Join types are discussed in the slides to follow, but also see the discussion at Join-queries.htm.
  • 27. The default type - includes records with corresponding values in both tables. LASTNAME FIRSTNAME DEPARTMENT Gray Eric CIS Gray Nadine HRS Cedarman YvonneHRS Malderer Kevin HRS Nale Rusty DEPARTMENT CODE NAME CIS Computer Information Systems HRS Human Resources WHS Warehouse Only red records are included in join. No department for Nale No Warehouse employees Inner Join 1  CIS HRS HRS HRS WHS
  • 28. Includes all records from One table and corresponding records from Many table Left Outer Join LASTNAME FIRSTNAME DEPARTMENT Gray Eric CIS Gray Nadine HRS Cedarman YvonneHRS Malderer Kevin HRS Nale Rusty DEPARTMENT CODE NAME CIS Computer Information Systems HRS Human Resources WHS Warehouse Rusty Nale not included – no department assigned. 1 
  • 29. How to Change the Join Properties in Query Design View Double-click on the join line that connects the tables. Click the bullet next to the join property desired. For example, in the 240students.mdb database, suppose we want all students and the pets they own. All students should be listed regardless of whether they own a pet or not. This is perfect for a Left Outer Join, because it will select a student from tblStudents (the “One” table) even if there isn’t a match (between ID and OwnerID) in tblPets (the “Many” table).
  • 30. Here’s the SQL and the result of running the query • The result of running this query (in the 240students.mdb database) Left-Join.htm. SELECT ID, FirstName, Name, Breed FROM tblStudents LEFT JOIN tblPets ON tblStudents.ID = tblPets.OwnerID
  • 31. LASTNAME FIRSTNAME DEPARTMENT Gray Eric CIS Gray Nadine HRS Cedarman YvonneHRS Malderer Kevin HRS Nale Rusty DEPARTMENT CODE NAME CIS Computer Information Systems HRS Human Resources WHS Warehouse Warehouse dept. not included – no employees assigned. Includes all records from Many table and corresponding records from One table. Right Outer Join 1 
  • 32. Join Types Joins displayed as Venn Diagrams A B Inner Join A B U A B Left Outer Join A is “one” table A and B are tables Green striped area is join dynaset. A B Right Outer Join B is “many” table
  • 33. Join Types Selected by double clicking on join line between two tables in Relationship window, and clicking Join Type button.
  • 34. Referential Integrity • Referential integrity keeps the relationships between tables valid. • All foreign keys have values that correspond to records in the referenced table • Maintain referential integrity by: – Updating and deleting records when matching records in a joined table are updated and deleted. – Eliminating unmatched and duplicated records in joined tables.
  • 35. Enforcing Referential Integrity • Normalize tables • Set field properties • Use lookup fields • Select specific join type settings • Create and run Find Duplicate and Find Unmatched queries
  • 36. Find Duplicate Records Query • Locates records with duplicate values in Many table. One table Many table Duplicates
  • 37. Find Unmatched Records Query Locates records in Many table not associated with record in One table One table Many table No match
  • 38. Maintaining Databases • Older versions of Access can be converted to newer versions, and vice versa. • Databases can be compacted and repaired using the Tools, Database Utilities command. • Databases can be split into two databases: data and objects (back and front end). • Databases can be documented using the Tools, Analyze, Documenter command. • Database performance can be analyzed using the Tools, Analyze, Performance command.
  • 39. Object Groups • Named set of shortcuts that point to database objects • Grouped objects are listed together in a single window.
  • 40. Modifying Access Environment • Tools, Options command allows changes to the behavior of Access. • Access standard toolbars can be modified.