SlideShare a Scribd company logo
1 of 46
Programming Logic and Design
Eighth Edition
Chapter 14
Using Relational Databases
Objectives
2
In this chapter, you will learn about:
• Relational database fundamentals
• Creating databases and table descriptions
• Primary keys
• Database structure notation
• Working with records within a table
• Creating queries
Programming Logic and Design, Eighth Edition
Objectives (continued)
3
• Relationships between tables
• Poor table design
• Anomalies, normal forms, and normalization
• Database performance and security issues
Programming Logic and Design, Eighth Edition
Understanding Relational Database
Fundamentals
4
• Data hierarchy
– Characters
– Fields
– Records
– Files
• Database
– Holds files that an organization needs to support
operations
– Files are called tables
Programming Logic and Design, Eighth Edition
Understanding Relational Database
Fundamentals (continued)
• Entity
– One record or row
• Attribute
– A column, or field
5
Figure 14-1 A telephone book table
Programming Logic and Design, Eighth Edition
Understanding Relational Database
Fundamentals (continued)
6
• Primary key
– Uniquely identifies a record
– Often defined as a single table column
– Can be a compound key or composite key (made up of
multiple fields)
• Database management software functions
– Create table descriptions
– Identify keys
– Add, delete, and update records within a table
Programming Logic and Design, Eighth Edition
Understanding Relational Database
Fundamentals (continued)
7
• Database management software functions (continued)
– Arrange records within a table so they are sorted by
different fields
– Write questions that combine information from multiple
tables
– Create reports
– Keep data secure
• Relational database
– A group of database tables from which you can make
these connections
Programming Logic and Design, Eighth Edition
8
Creating Databases and Table
Descriptions
• Planning and analysis are critical
• Create the database itself
– Name it and indicate the physical location
• Save a table
– Provide a name that begins with the prefix “tbl”
• tblCustomers
• Design the table
– Decide what columns your table needs and name them
– Provide a data type for each column
Programming Logic and Design, Eighth Edition
9
Creating Databases and Table
Descriptions (continued)
Figure 14-2 Customer table description
Programming Logic and Design, Eighth Edition
10
Creating Databases and Table
Descriptions (continued)
• Text columns
– Hold any type of characters: letters or digits
• Numeric columns
– Hold numbers only
• Other possible column types
– Numeric subtypes
– Boolean
– Currency
• Can add descriptions
Programming Logic and Design, Eighth Edition
11
Identifying Primary Keys
• Primary key
– A column that makes each record different from all others
• Examples
– Customer ID, Student ID number, Part number
• Candidate keys – multiple fields in a record that are
unique and could be primary keys
• Alternate keys – candidate keys that were not
chosen as the primary key
• Primary keys should be immutable (values do not
change)
Programming Logic and Design, Eighth Edition
12
Identifying Primary Keys (continued)
Figure 14-3 Table containing residence hall student records
Programming Logic and Design, Eighth Edition
13
Understanding Database
Structure Notation
• A shorthand way to describe a table
– Table name followed by parentheses containing all the
field names
– Primary key underlined
• Example
tblStudents(idNumber, lastName,
firstName, gradePointAverage)
• Provides a quick overview of the table’s structure
– Does not provide information about data types or range
limits on values
Programming Logic and Design, Eighth Edition
Working With Records Within
Tables
14
• Entering data
– Requires time and accuracy
– Method depends on database software
• Deleting and modifying data
– Keeping records up to date is vital
Programming Logic and Design, Eighth Edition
Working With Records Within
Tables (continued)
15
• Database management software allows you to:
– Sort a table based on any column, or on multiple columns
– Group rows after sorting
– Add subtotals
– Create displays in the format that suits your needs
Programming Logic and Design, Eighth Edition
Creating Queries
16
• View subsets of data from a table you have created
– Examine only those customers with an address in a
specific state
• Limit the columns that you view
– A school administrator might only be interested in looking
at names and grade point averages
• Query
– A question using the syntax that the database software
can understand
Programming Logic and Design, Eighth Edition
Creating Queries (continued)
17
• Query by example
– Create a query by filling in blanks
• Write statements in Structured Query Language, or
SQL
• SELECT-FROM-WHERE
– Select the columns you want to see
– From the tables that have those columns
– Where one or more conditions are met
Programming Logic and Design, Eighth Edition
Creating Queries (continued)
18
– Example
SELECT custId, lastName
FROM tblCustomer
WHERE state = "WI"
• View - a particular way of looking at a database by
selecting specific fields and records, or placing
records in a selected order
– Wildcard
• Examples
• SELECT * FROM tblCustomer
WHERE state = "WI"
• SELECT * FROM tblCustomer
Programming Logic and Design, Eighth Edition
Creating Queries (continued)
19
Figure 14-5 Sample SQL statements and explanations
Programming Logic and Design, Eighth Edition
Understanding Relationships
between Tables
20
• Most database applications require many related
tables
• Relationship
– Connection between two tables
• Join operation
– Connecting two tables based on the values in a common
column called the join column
• Virtual table
– A table that is displayed as the result of the query
Programming Logic and Design, Eighth Edition
Understanding Relationships
Between Tables (continued)
21
• Three types of relationships:
– One-to-many
– Many-to-many
– One-to-one
Programming Logic and Design, Eighth Edition
22
Understanding Relationships
Between Tables (continued)
Figure 14-6 Sample customers and orders
Programming Logic and Design, Eighth Edition
Understanding One-To-Many
Relationships
23
• One-to-many relationship
• One row in a table can be related to many rows in
another table
• The most common type of relationship between tables
• Example
tblCustomers(customerNumber, customerName)
tblOrders(orderNumber, customerNumber,
orderQuantity, orderItem, orderDate)
– One row in the tblCustomers table can correspond to, and
be related to, many rows in the tblOrders table
Programming Logic and Design, Eighth Edition
Understanding One-To-Many
Relationships (continued)
24
• Base table: tblCustomers
• Related table: tblOrders
• customerNumber attribute links the two tables
together
• Nonkey attribute
• Foreign key
– When a column that is not a key in a table contains an
attribute that is a key in a related table
Programming Logic and Design, Eighth Edition
Understanding Many-To-Many
Relationships
25
Figure 14-7 Sample items and categories: a one-to-many relationship
Programming Logic and Design, Eighth Edition
Understanding Many-To-Many
Relationships (continued)
26
• Many-to-many relationship
– Multiple rows in each table can correspond to multiple
rows in the other
• One specific row in the tblItems table can link to
many rows in the tblCategories table
– Cannot continue to maintain the foreign key
itemCategoryId in the tblItems table
• The simplest way to support a many-to-many
relationship is to remove the itemCategoryId
attribute
Programming Logic and Design, Eighth Edition
Understanding Many-To-Many
Relationships (continued)
27
• Example
tblItems(itemNumber, itemName,
itemPurchaseDate, itemPurchasePrice,
itemCategoryId)
tblCategories(categoryId, categoryName,
categoryInsuredAmount)
• New table
tblItemsCategories(itemNumber,
categoryId)
Programming Logic and Design, Eighth Edition
Understanding Many-To-Many
Relationships (continued)
28
Figure 14-8 Sample items, categories, and item categories:
a many-to-many relationship
Programming Logic and Design, Eighth Edition
Understanding One-To-One
Relationships
29
• One-to-one relationship
• A row in one table corresponds to exactly one row
in another table
• The least frequently encountered
• A common reason to create a one-to-one
relationship is security
Figure 14-9 Employees and salaries tables: a one-to-one relationship
Programming Logic and Design, Eighth Edition
Recognizing Poor Table Design
30
• The design must support the needs of the
application
• It must not be cumbersome to use
• Potential problems with simple table design
• Avoid repeating fields (class/classTitle)
Figure 14-10 Students table before normalization
Programming Logic and Design, Eighth Edition
Understanding Anomalies, Normal
Forms, and Normalization
• Normalization
– Helps you reduce
data redundancies
and anomalies
• Types of anomalies:
– Update
– Delete
– Insert
31
• Three normal forms:
– First normal form, or 1NF
(eliminate repeating
groups)
– Second normal form, or
2NF (eliminate partial key
dependencies)
– Third normal form, or 3NF
(eliminate transitive
dependencies)
Programming Logic and Design, Eighth Edition
First Normal Form
32
• Unnormalized
– A table that contains repeating groups (a subset of rows
that depend on the same key)
• 1NF
– Contains no repeating groups of data
• Sample table
– class and classTitle attributes repeat multiple
times for some of the students
– Repeat the rows for each repeating group of data
– Create a combined key of studentId and class
Programming Logic and Design, Eighth Edition
First Normal Form (continued)
33
Figure 14-11 Students table in 1NF
• Atomic attributes
– As small as possible, containing an undividable piece of
data
Programming Logic and Design, Eighth Edition
Second Normal Form
34
• Eliminate all partial key dependencies
• No column should depend on only part of the key
• Must be in 1NF
• All nonkey attributes must be dependent on the
entire primary key
• Create multiple tables
– Each nonkey attribute of each table is dependent on the
entire primary key for the specific table within which the
attribute occurs
Programming Logic and Design, Eighth Edition
35
Figure 14-12 Students table in 2NF
Second Normal Form (continued)
Programming Logic and Design, Eighth Edition
Second Normal Form (continued)
36
• When breaking up a table into multiple tables:
– Consider the type of relationship among the resulting
tables
– Determine what type of relationship exists between the
two tables
Programming Logic and Design, Eighth Edition
Third Normal Form
37
• The table must be in 2NF, and it has no transitive
dependencies
• Transitive dependency
– The value of a nonkey attribute determines, or predicts,
the value of another nonkey attribute
– Example: zip code determines city and state
• Remove the attributes that are determined by, or
are functionally dependent on, the zip attribute
Programming Logic and Design, Eighth Edition
Third Normal Form (continued)
38
Figure 14-13 The complete Students database
Programming Logic and Design, Eighth Edition
39
Database Performance
and Security Issues
• Major issues
– Providing data integrity
– Recovering lost data
– Avoiding concurrent update problems
– Providing authentication and permissions
– Providing encryption
Programming Logic and Design, Eighth Edition
40
Providing Data Integrity
• Data integrity
– A set of rules that makes the data accurate and consistent
• Can enforce referential integrity between tables
– Example
• A city cannot be entered as data unless the state that city
belongs to is already created
Programming Logic and Design, Eighth Edition
41
Recovering Lost Data
• An organization’s data can be destroyed in many
ways
• Recovery
– The process of returning the database to a correct form
that existed before an error occurred
• Periodically make a backup copy of a database and
keep a record of every transaction
Programming Logic and Design, Eighth Edition
Avoiding Concurrent Update
Problems
42
• Concurrent update problem
– Occurs when two database users need to modify the
same record at the same time
• Lock and persistent (long-term) lock
– A mechanism that prevents changes to a database for a
period of time
• Do not allow users to update the original database
at all
– Store transactions and then later apply them to the
database all at once, or in a batch
Programming Logic and Design, Eighth Edition
Providing Authentication and
Permissions
43
• Authentication techniques include:
– Storing and verifying passwords
– Using physical characteristics
• Permissions assigned
– Indicate which parts of the database the user can view,
modify, or delete
Programming Logic and Design, Eighth Edition
44
Providing Encryption
• Encryption
– The process of coding data into a format that human
beings cannot read
• Only authorized users see the data in a readable
format
Programming Logic and Design, Eighth Edition
Summary
45
• A database holds a group of files that an
organization needs to support its applications
• Create tables
– Identify primary key
• Use shorthand to describe a table
– tblItemsCategories(itemNumber,
categoryId)
• Database operations
– Sort, add, edit, delete, query
Programming Logic and Design, Eighth Edition
Summary (continued)
46
• Table relationships
– One-to-many, many-to-many, one-to-one
• Normalization
– Reduce data redundancy, update anomalies, delete
anomalies, insert anomalies,
– First, Second, Third Normal Form
• A database is a company’s most valuable asset
– Must provide security and integrity
Programming Logic and Design, Eighth Edition

More Related Content

What's hot

CIS110 Computer Programming Design Chapter (4)
CIS110 Computer Programming Design Chapter  (4)CIS110 Computer Programming Design Chapter  (4)
CIS110 Computer Programming Design Chapter (4)Dr. Ahmed Al Zaidy
 
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
Chapter 12 Lecture: GUI Programming, Multithreading, and AnimationChapter 12 Lecture: GUI Programming, Multithreading, and Animation
Chapter 12 Lecture: GUI Programming, Multithreading, and AnimationNicole Ryan
 
CIS110 Computer Programming Design Chapter (6)
CIS110 Computer Programming Design Chapter  (6)CIS110 Computer Programming Design Chapter  (6)
CIS110 Computer Programming Design Chapter (6)Dr. Ahmed Al Zaidy
 
Intro to Programming: Modularity
Intro to Programming: ModularityIntro to Programming: Modularity
Intro to Programming: ModularityNicole Ryan
 
Chapter 11: Object Oriented Programming Part 2
Chapter 11: Object Oriented Programming Part 2Chapter 11: Object Oriented Programming Part 2
Chapter 11: Object Oriented Programming Part 2Nicole Ryan
 
Logic Formulation 3
Logic Formulation 3Logic Formulation 3
Logic Formulation 3deathful
 
Algorithms
AlgorithmsAlgorithms
AlgorithmsDevMix
 
Logic Formulation 2
Logic Formulation 2Logic Formulation 2
Logic Formulation 2deathful
 
5 problem solving with the sequential logic structure
5 problem solving with the sequential logic structure5 problem solving with the sequential logic structure
5 problem solving with the sequential logic structureRheigh Henley Calderon
 
12 si(systems analysis and design )
12 si(systems analysis and design )12 si(systems analysis and design )
12 si(systems analysis and design )Nurdin Al-Azies
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptaviban
 
Program logic and design
Program logic and designProgram logic and design
Program logic and designChaffey College
 
BASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTUREBASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTUREVENNILAV6
 

What's hot (17)

CIS110 Computer Programming Design Chapter (4)
CIS110 Computer Programming Design Chapter  (4)CIS110 Computer Programming Design Chapter  (4)
CIS110 Computer Programming Design Chapter (4)
 
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
Chapter 12 Lecture: GUI Programming, Multithreading, and AnimationChapter 12 Lecture: GUI Programming, Multithreading, and Animation
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
 
CIS110 Computer Programming Design Chapter (6)
CIS110 Computer Programming Design Chapter  (6)CIS110 Computer Programming Design Chapter  (6)
CIS110 Computer Programming Design Chapter (6)
 
Intro to Programming: Modularity
Intro to Programming: ModularityIntro to Programming: Modularity
Intro to Programming: Modularity
 
Chapter 11: Object Oriented Programming Part 2
Chapter 11: Object Oriented Programming Part 2Chapter 11: Object Oriented Programming Part 2
Chapter 11: Object Oriented Programming Part 2
 
Logic Formulation 3
Logic Formulation 3Logic Formulation 3
Logic Formulation 3
 
Unit i
Unit iUnit i
Unit i
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Logic Formulation 2
Logic Formulation 2Logic Formulation 2
Logic Formulation 2
 
5 problem solving with the sequential logic structure
5 problem solving with the sequential logic structure5 problem solving with the sequential logic structure
5 problem solving with the sequential logic structure
 
12 si(systems analysis and design )
12 si(systems analysis and design )12 si(systems analysis and design )
12 si(systems analysis and design )
 
Unit 1
Unit 1Unit 1
Unit 1
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 ppt
 
Program logic and design
Program logic and designProgram logic and design
Program logic and design
 
BASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTUREBASICS OF DATA STRUCTURE
BASICS OF DATA STRUCTURE
 
Lesson 3.2 data types for memory location
Lesson 3.2 data types for memory locationLesson 3.2 data types for memory location
Lesson 3.2 data types for memory location
 

Similar to CIS110 Computer Programming Design Chapter (14)

chapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdfchapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdfsatonaka3
 
chapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdfchapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdfAxmedMaxamuud6
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLEDrkhanchanaR
 
Chapter 9 Data Design .pptxInformation Technology Project Management
Chapter 9 Data Design .pptxInformation Technology Project ManagementChapter 9 Data Design .pptxInformation Technology Project Management
Chapter 9 Data Design .pptxInformation Technology Project ManagementAxmedMaxamuudYoonis
 
lec02-data-models-sql-basics.pptx
lec02-data-models-sql-basics.pptxlec02-data-models-sql-basics.pptx
lec02-data-models-sql-basics.pptxcAnhTrn53
 
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
 
IS230 - Chapter 4 - Keys and Relationship - Revised.ppt
IS230 - Chapter 4 - Keys and Relationship - Revised.pptIS230 - Chapter 4 - Keys and Relationship - Revised.ppt
IS230 - Chapter 4 - Keys and Relationship - Revised.pptwondmhunegn
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelKunal Anand
 
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
 
HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08Steve Guinan
 

Similar to CIS110 Computer Programming Design Chapter (14) (20)

chapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdfchapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdf
 
chapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdfchapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdf
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLE
 
Chapter 9 Data Design .pptxInformation Technology Project Management
Chapter 9 Data Design .pptxInformation Technology Project ManagementChapter 9 Data Design .pptxInformation Technology Project Management
Chapter 9 Data Design .pptxInformation Technology Project Management
 
lec02-data-models-sql-basics.pptx
lec02-data-models-sql-basics.pptxlec02-data-models-sql-basics.pptx
lec02-data-models-sql-basics.pptx
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
 
MS ACCESS
MS ACCESSMS ACCESS
MS ACCESS
 
Database intro
Database introDatabase intro
Database intro
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 
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
 
IS230 - Chapter 4 - Keys and Relationship - Revised.ppt
IS230 - Chapter 4 - Keys and Relationship - Revised.pptIS230 - Chapter 4 - Keys and Relationship - Revised.ppt
IS230 - Chapter 4 - Keys and Relationship - Revised.ppt
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
BUS-Chapter 07.ppt
BUS-Chapter 07.pptBUS-Chapter 07.ppt
BUS-Chapter 07.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 .docx
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
Uses of MS Access in Business
Uses of MS Access in BusinessUses of MS Access in Business
Uses of MS Access in Business
 
DB2 on Mainframe
DB2 on MainframeDB2 on Mainframe
DB2 on Mainframe
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08
 

More from Dr. Ahmed Al Zaidy

Chapter 14 Exploring Object-based Programming
Chapter 14 Exploring Object-based ProgrammingChapter 14 Exploring Object-based Programming
Chapter 14 Exploring Object-based ProgrammingDr. Ahmed Al Zaidy
 
Chapter 13 Programming for web forms
Chapter 13 Programming for web formsChapter 13 Programming for web forms
Chapter 13 Programming for web formsDr. Ahmed Al Zaidy
 
Chapter 12 Working with Document nodes and style sheets
Chapter 12 Working with Document nodes and style sheetsChapter 12 Working with Document nodes and style sheets
Chapter 12 Working with Document nodes and style sheetsDr. Ahmed Al Zaidy
 
Chapter 11 Working with Events and Styles
Chapter 11 Working with Events and StylesChapter 11 Working with Events and Styles
Chapter 11 Working with Events and StylesDr. Ahmed Al Zaidy
 
Chapter 10 Exploring arrays, loops, and conditional statements
Chapter 10 Exploring arrays, loops, and conditional statementsChapter 10 Exploring arrays, loops, and conditional statements
Chapter 10 Exploring arrays, loops, and conditional statementsDr. Ahmed Al Zaidy
 
Chapter 9 Getting Started with JavaScript
Chapter 9 Getting Started with JavaScriptChapter 9 Getting Started with JavaScript
Chapter 9 Getting Started with JavaScriptDr. Ahmed Al Zaidy
 
Chapter 8 Enhancing a website with multimedia
Chapter 8 Enhancing a website with multimediaChapter 8 Enhancing a website with multimedia
Chapter 8 Enhancing a website with multimediaDr. Ahmed Al Zaidy
 
Chapter 7 Designing a web form
Chapter 7 Designing a web formChapter 7 Designing a web form
Chapter 7 Designing a web formDr. Ahmed Al Zaidy
 
Chapter 6 Working with Tables and Columns
Chapter 6 Working with Tables and ColumnsChapter 6 Working with Tables and Columns
Chapter 6 Working with Tables and ColumnsDr. Ahmed Al Zaidy
 
Chapter 5 Designing for the mobile web
Chapter 5 Designing for the mobile webChapter 5 Designing for the mobile web
Chapter 5 Designing for the mobile webDr. Ahmed Al Zaidy
 
Chapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSSChapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSSDr. Ahmed Al Zaidy
 
Chapter 3 Designing a Page Layout
Chapter 3 Designing a Page LayoutChapter 3 Designing a Page Layout
Chapter 3 Designing a Page LayoutDr. Ahmed Al Zaidy
 
Chapter 2 Getting Started with CSS
Chapter 2 Getting Started with CSSChapter 2 Getting Started with CSS
Chapter 2 Getting Started with CSSDr. Ahmed Al Zaidy
 
Chapter 1 Getting Started with HTML5
Chapter 1 Getting Started with HTML5Chapter 1 Getting Started with HTML5
Chapter 1 Getting Started with HTML5Dr. Ahmed Al Zaidy
 
testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2Dr. Ahmed Al Zaidy
 
Chapter 14 Business Continuity
Chapter 14 Business ContinuityChapter 14 Business Continuity
Chapter 14 Business ContinuityDr. Ahmed Al Zaidy
 
Chapter 13 Vulnerability Assessment and Data Security
Chapter 13 Vulnerability Assessment and Data SecurityChapter 13 Vulnerability Assessment and Data Security
Chapter 13 Vulnerability Assessment and Data SecurityDr. Ahmed Al Zaidy
 

More from Dr. Ahmed Al Zaidy (20)

Chapter 14 Exploring Object-based Programming
Chapter 14 Exploring Object-based ProgrammingChapter 14 Exploring Object-based Programming
Chapter 14 Exploring Object-based Programming
 
Chapter 13 Programming for web forms
Chapter 13 Programming for web formsChapter 13 Programming for web forms
Chapter 13 Programming for web forms
 
Chapter 12 Working with Document nodes and style sheets
Chapter 12 Working with Document nodes and style sheetsChapter 12 Working with Document nodes and style sheets
Chapter 12 Working with Document nodes and style sheets
 
Chapter 11 Working with Events and Styles
Chapter 11 Working with Events and StylesChapter 11 Working with Events and Styles
Chapter 11 Working with Events and Styles
 
Chapter 10 Exploring arrays, loops, and conditional statements
Chapter 10 Exploring arrays, loops, and conditional statementsChapter 10 Exploring arrays, loops, and conditional statements
Chapter 10 Exploring arrays, loops, and conditional statements
 
Chapter 9 Getting Started with JavaScript
Chapter 9 Getting Started with JavaScriptChapter 9 Getting Started with JavaScript
Chapter 9 Getting Started with JavaScript
 
Chapter 8 Enhancing a website with multimedia
Chapter 8 Enhancing a website with multimediaChapter 8 Enhancing a website with multimedia
Chapter 8 Enhancing a website with multimedia
 
Chapter 7 Designing a web form
Chapter 7 Designing a web formChapter 7 Designing a web form
Chapter 7 Designing a web form
 
Chapter 6 Working with Tables and Columns
Chapter 6 Working with Tables and ColumnsChapter 6 Working with Tables and Columns
Chapter 6 Working with Tables and Columns
 
Chapter 5 Designing for the mobile web
Chapter 5 Designing for the mobile webChapter 5 Designing for the mobile web
Chapter 5 Designing for the mobile web
 
Chapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSSChapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSS
 
Chapter 3 Designing a Page Layout
Chapter 3 Designing a Page LayoutChapter 3 Designing a Page Layout
Chapter 3 Designing a Page Layout
 
Chapter 2 Getting Started with CSS
Chapter 2 Getting Started with CSSChapter 2 Getting Started with CSS
Chapter 2 Getting Started with CSS
 
Chapter 1 Getting Started with HTML5
Chapter 1 Getting Started with HTML5Chapter 1 Getting Started with HTML5
Chapter 1 Getting Started with HTML5
 
Integer overflows
Integer overflowsInteger overflows
Integer overflows
 
testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2
 
Fundamental of testing
Fundamental of testingFundamental of testing
Fundamental of testing
 
Chapter 15 Risk Mitigation
Chapter 15 Risk MitigationChapter 15 Risk Mitigation
Chapter 15 Risk Mitigation
 
Chapter 14 Business Continuity
Chapter 14 Business ContinuityChapter 14 Business Continuity
Chapter 14 Business Continuity
 
Chapter 13 Vulnerability Assessment and Data Security
Chapter 13 Vulnerability Assessment and Data SecurityChapter 13 Vulnerability Assessment and Data Security
Chapter 13 Vulnerability Assessment and Data Security
 

Recently uploaded

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

CIS110 Computer Programming Design Chapter (14)

  • 1. Programming Logic and Design Eighth Edition Chapter 14 Using Relational Databases
  • 2. Objectives 2 In this chapter, you will learn about: • Relational database fundamentals • Creating databases and table descriptions • Primary keys • Database structure notation • Working with records within a table • Creating queries Programming Logic and Design, Eighth Edition
  • 3. Objectives (continued) 3 • Relationships between tables • Poor table design • Anomalies, normal forms, and normalization • Database performance and security issues Programming Logic and Design, Eighth Edition
  • 4. Understanding Relational Database Fundamentals 4 • Data hierarchy – Characters – Fields – Records – Files • Database – Holds files that an organization needs to support operations – Files are called tables Programming Logic and Design, Eighth Edition
  • 5. Understanding Relational Database Fundamentals (continued) • Entity – One record or row • Attribute – A column, or field 5 Figure 14-1 A telephone book table Programming Logic and Design, Eighth Edition
  • 6. Understanding Relational Database Fundamentals (continued) 6 • Primary key – Uniquely identifies a record – Often defined as a single table column – Can be a compound key or composite key (made up of multiple fields) • Database management software functions – Create table descriptions – Identify keys – Add, delete, and update records within a table Programming Logic and Design, Eighth Edition
  • 7. Understanding Relational Database Fundamentals (continued) 7 • Database management software functions (continued) – Arrange records within a table so they are sorted by different fields – Write questions that combine information from multiple tables – Create reports – Keep data secure • Relational database – A group of database tables from which you can make these connections Programming Logic and Design, Eighth Edition
  • 8. 8 Creating Databases and Table Descriptions • Planning and analysis are critical • Create the database itself – Name it and indicate the physical location • Save a table – Provide a name that begins with the prefix “tbl” • tblCustomers • Design the table – Decide what columns your table needs and name them – Provide a data type for each column Programming Logic and Design, Eighth Edition
  • 9. 9 Creating Databases and Table Descriptions (continued) Figure 14-2 Customer table description Programming Logic and Design, Eighth Edition
  • 10. 10 Creating Databases and Table Descriptions (continued) • Text columns – Hold any type of characters: letters or digits • Numeric columns – Hold numbers only • Other possible column types – Numeric subtypes – Boolean – Currency • Can add descriptions Programming Logic and Design, Eighth Edition
  • 11. 11 Identifying Primary Keys • Primary key – A column that makes each record different from all others • Examples – Customer ID, Student ID number, Part number • Candidate keys – multiple fields in a record that are unique and could be primary keys • Alternate keys – candidate keys that were not chosen as the primary key • Primary keys should be immutable (values do not change) Programming Logic and Design, Eighth Edition
  • 12. 12 Identifying Primary Keys (continued) Figure 14-3 Table containing residence hall student records Programming Logic and Design, Eighth Edition
  • 13. 13 Understanding Database Structure Notation • A shorthand way to describe a table – Table name followed by parentheses containing all the field names – Primary key underlined • Example tblStudents(idNumber, lastName, firstName, gradePointAverage) • Provides a quick overview of the table’s structure – Does not provide information about data types or range limits on values Programming Logic and Design, Eighth Edition
  • 14. Working With Records Within Tables 14 • Entering data – Requires time and accuracy – Method depends on database software • Deleting and modifying data – Keeping records up to date is vital Programming Logic and Design, Eighth Edition
  • 15. Working With Records Within Tables (continued) 15 • Database management software allows you to: – Sort a table based on any column, or on multiple columns – Group rows after sorting – Add subtotals – Create displays in the format that suits your needs Programming Logic and Design, Eighth Edition
  • 16. Creating Queries 16 • View subsets of data from a table you have created – Examine only those customers with an address in a specific state • Limit the columns that you view – A school administrator might only be interested in looking at names and grade point averages • Query – A question using the syntax that the database software can understand Programming Logic and Design, Eighth Edition
  • 17. Creating Queries (continued) 17 • Query by example – Create a query by filling in blanks • Write statements in Structured Query Language, or SQL • SELECT-FROM-WHERE – Select the columns you want to see – From the tables that have those columns – Where one or more conditions are met Programming Logic and Design, Eighth Edition
  • 18. Creating Queries (continued) 18 – Example SELECT custId, lastName FROM tblCustomer WHERE state = "WI" • View - a particular way of looking at a database by selecting specific fields and records, or placing records in a selected order – Wildcard • Examples • SELECT * FROM tblCustomer WHERE state = "WI" • SELECT * FROM tblCustomer Programming Logic and Design, Eighth Edition
  • 19. Creating Queries (continued) 19 Figure 14-5 Sample SQL statements and explanations Programming Logic and Design, Eighth Edition
  • 20. Understanding Relationships between Tables 20 • Most database applications require many related tables • Relationship – Connection between two tables • Join operation – Connecting two tables based on the values in a common column called the join column • Virtual table – A table that is displayed as the result of the query Programming Logic and Design, Eighth Edition
  • 21. Understanding Relationships Between Tables (continued) 21 • Three types of relationships: – One-to-many – Many-to-many – One-to-one Programming Logic and Design, Eighth Edition
  • 22. 22 Understanding Relationships Between Tables (continued) Figure 14-6 Sample customers and orders Programming Logic and Design, Eighth Edition
  • 23. Understanding One-To-Many Relationships 23 • One-to-many relationship • One row in a table can be related to many rows in another table • The most common type of relationship between tables • Example tblCustomers(customerNumber, customerName) tblOrders(orderNumber, customerNumber, orderQuantity, orderItem, orderDate) – One row in the tblCustomers table can correspond to, and be related to, many rows in the tblOrders table Programming Logic and Design, Eighth Edition
  • 24. Understanding One-To-Many Relationships (continued) 24 • Base table: tblCustomers • Related table: tblOrders • customerNumber attribute links the two tables together • Nonkey attribute • Foreign key – When a column that is not a key in a table contains an attribute that is a key in a related table Programming Logic and Design, Eighth Edition
  • 25. Understanding Many-To-Many Relationships 25 Figure 14-7 Sample items and categories: a one-to-many relationship Programming Logic and Design, Eighth Edition
  • 26. Understanding Many-To-Many Relationships (continued) 26 • Many-to-many relationship – Multiple rows in each table can correspond to multiple rows in the other • One specific row in the tblItems table can link to many rows in the tblCategories table – Cannot continue to maintain the foreign key itemCategoryId in the tblItems table • The simplest way to support a many-to-many relationship is to remove the itemCategoryId attribute Programming Logic and Design, Eighth Edition
  • 27. Understanding Many-To-Many Relationships (continued) 27 • Example tblItems(itemNumber, itemName, itemPurchaseDate, itemPurchasePrice, itemCategoryId) tblCategories(categoryId, categoryName, categoryInsuredAmount) • New table tblItemsCategories(itemNumber, categoryId) Programming Logic and Design, Eighth Edition
  • 28. Understanding Many-To-Many Relationships (continued) 28 Figure 14-8 Sample items, categories, and item categories: a many-to-many relationship Programming Logic and Design, Eighth Edition
  • 29. Understanding One-To-One Relationships 29 • One-to-one relationship • A row in one table corresponds to exactly one row in another table • The least frequently encountered • A common reason to create a one-to-one relationship is security Figure 14-9 Employees and salaries tables: a one-to-one relationship Programming Logic and Design, Eighth Edition
  • 30. Recognizing Poor Table Design 30 • The design must support the needs of the application • It must not be cumbersome to use • Potential problems with simple table design • Avoid repeating fields (class/classTitle) Figure 14-10 Students table before normalization Programming Logic and Design, Eighth Edition
  • 31. Understanding Anomalies, Normal Forms, and Normalization • Normalization – Helps you reduce data redundancies and anomalies • Types of anomalies: – Update – Delete – Insert 31 • Three normal forms: – First normal form, or 1NF (eliminate repeating groups) – Second normal form, or 2NF (eliminate partial key dependencies) – Third normal form, or 3NF (eliminate transitive dependencies) Programming Logic and Design, Eighth Edition
  • 32. First Normal Form 32 • Unnormalized – A table that contains repeating groups (a subset of rows that depend on the same key) • 1NF – Contains no repeating groups of data • Sample table – class and classTitle attributes repeat multiple times for some of the students – Repeat the rows for each repeating group of data – Create a combined key of studentId and class Programming Logic and Design, Eighth Edition
  • 33. First Normal Form (continued) 33 Figure 14-11 Students table in 1NF • Atomic attributes – As small as possible, containing an undividable piece of data Programming Logic and Design, Eighth Edition
  • 34. Second Normal Form 34 • Eliminate all partial key dependencies • No column should depend on only part of the key • Must be in 1NF • All nonkey attributes must be dependent on the entire primary key • Create multiple tables – Each nonkey attribute of each table is dependent on the entire primary key for the specific table within which the attribute occurs Programming Logic and Design, Eighth Edition
  • 35. 35 Figure 14-12 Students table in 2NF Second Normal Form (continued) Programming Logic and Design, Eighth Edition
  • 36. Second Normal Form (continued) 36 • When breaking up a table into multiple tables: – Consider the type of relationship among the resulting tables – Determine what type of relationship exists between the two tables Programming Logic and Design, Eighth Edition
  • 37. Third Normal Form 37 • The table must be in 2NF, and it has no transitive dependencies • Transitive dependency – The value of a nonkey attribute determines, or predicts, the value of another nonkey attribute – Example: zip code determines city and state • Remove the attributes that are determined by, or are functionally dependent on, the zip attribute Programming Logic and Design, Eighth Edition
  • 38. Third Normal Form (continued) 38 Figure 14-13 The complete Students database Programming Logic and Design, Eighth Edition
  • 39. 39 Database Performance and Security Issues • Major issues – Providing data integrity – Recovering lost data – Avoiding concurrent update problems – Providing authentication and permissions – Providing encryption Programming Logic and Design, Eighth Edition
  • 40. 40 Providing Data Integrity • Data integrity – A set of rules that makes the data accurate and consistent • Can enforce referential integrity between tables – Example • A city cannot be entered as data unless the state that city belongs to is already created Programming Logic and Design, Eighth Edition
  • 41. 41 Recovering Lost Data • An organization’s data can be destroyed in many ways • Recovery – The process of returning the database to a correct form that existed before an error occurred • Periodically make a backup copy of a database and keep a record of every transaction Programming Logic and Design, Eighth Edition
  • 42. Avoiding Concurrent Update Problems 42 • Concurrent update problem – Occurs when two database users need to modify the same record at the same time • Lock and persistent (long-term) lock – A mechanism that prevents changes to a database for a period of time • Do not allow users to update the original database at all – Store transactions and then later apply them to the database all at once, or in a batch Programming Logic and Design, Eighth Edition
  • 43. Providing Authentication and Permissions 43 • Authentication techniques include: – Storing and verifying passwords – Using physical characteristics • Permissions assigned – Indicate which parts of the database the user can view, modify, or delete Programming Logic and Design, Eighth Edition
  • 44. 44 Providing Encryption • Encryption – The process of coding data into a format that human beings cannot read • Only authorized users see the data in a readable format Programming Logic and Design, Eighth Edition
  • 45. Summary 45 • A database holds a group of files that an organization needs to support its applications • Create tables – Identify primary key • Use shorthand to describe a table – tblItemsCategories(itemNumber, categoryId) • Database operations – Sort, add, edit, delete, query Programming Logic and Design, Eighth Edition
  • 46. Summary (continued) 46 • Table relationships – One-to-many, many-to-many, one-to-one • Normalization – Reduce data redundancy, update anomalies, delete anomalies, insert anomalies, – First, Second, Third Normal Form • A database is a company’s most valuable asset – Must provide security and integrity Programming Logic and Design, Eighth Edition