Chapter 5
-
Upload
noel-noble -
Category
Documents
-
view
17 -
download
0
description
Transcript of Chapter 5
![Page 1: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/1.jpg)
Chapter 5
Relationships & Queries in Databases
![Page 2: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/2.jpg)
Types of Relationships
One to One Examples? Analysis Technique
Consider ThingA and ThingB Can ThingA be related to more than one ThingB? Can ThingB be related to more than one ThingA? If the two answers are NO, then it is a one to one
relationship.
![Page 3: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/3.jpg)
Types of Relationships
One to Many Examples? Analysis Technique
Consider ThingA and ThingB Can ThingA be related to more than one ThingB? Can ThingB be related to more than one ThingA? If the answers are no and yes, or yes and no, then
the relationship is one to many.
![Page 4: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/4.jpg)
Types of Relationships
Many to Many Examples? Analysis Technique
Consider ThingA and ThingB Can ThingA be related to more than one ThingB? Can ThingB be related to more than one ThingA? If the answers are yes and yes, then you have a
many to many relationship
![Page 5: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/5.jpg)
Hierarchical Leads to Serious Data Redundancy
![Page 6: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/6.jpg)
Hierarchical
![Page 7: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/7.jpg)
Network
![Page 8: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/8.jpg)
NetworkDifficult to manage
and implement relationships
![Page 9: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/9.jpg)
RelationalThe most popular
structure
![Page 10: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/10.jpg)
Relational
CustomersCID FName LName Address
508 Eric Breimer ...
509 Andrew Zych ...
510 Greg Smith ...
ProductsPID Description Cost
199 Viagra $45.99
200 Tooth Paste $2.58
201 Hair Gel $5.99
OrdersOID CID PID Quantity
001 508 199 500,000
002 508 201 2
003 510 201 1
![Page 11: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/11.jpg)
Find the name and hire date of the manager working on the sales manual project
![Page 12: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/12.jpg)
Schemas
Schema - A description of the database
Subschema – describes a subset of the database and which users have access to this subset
![Page 13: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/13.jpg)
Data Definition Language
Language Used to describe Schemas and Subschemas
Describes relationships between different data
Provides a Logical view of the data
![Page 14: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/14.jpg)
Data Dictionary Entry
A more detailed description of the data in a database
Specifies data types and ranges
Assists programmers in understanding the data
![Page 15: Chapter 5](https://reader030.fdocuments.us/reader030/viewer/2022032414/568132ac550346895d995939/html5/thumbnails/15.jpg)
Logical vs. Physical Access Paths
Database Management Systems concentrate on Physical access to the underlying tables Concurrency control Query’s Creating/deleting tables
MIS systems are often software packages that (Logically) interface with a DBMS monthly reports charts automated inquiries