Documente Academic
Documente Profesional
Documente Cultură
All Data
DBMS
7
Components of a DBMS
Database engine
Data dictionary
Query processor
Report writer
Forms generator
Application generator
Communication
Security
Sample Data Table
The Database Approach
DBMS replaced file processing approach
– Reduced data redundancy
– Reduced program dependence
Databases typically consist of several tables
Tables can be linked together
Advantages of a DBMS
14
Database Management
Systems Approaches
Models of the relationship between entities
in a database
– Hierarchical
– Network
– Relational
– Object -Oriented
The Hierarchical Model
The Network Model
Database Fundamentals - Object-Oriented
Model
Object-Oriented Paradigm
– Programming Languages
– Analysis and Design Methodologies
– Databases and DBMS
O-O Advantages
– More modeling power
– Additional constructs
– Better transition to implementation models
Database Fundamentals - Object-Oriented
Model
O-O Applications
– CAD, Office Information Systems, CASE
tools, GIS
– Structurally complex information, specialized
graphics, non-standard transactions
Database Fundamentals - Object-Oriented Model
O-O DBMS
– Standard DBMS capabilities
Scheme management
Query language and optimization
Storage and access management
Transaction management
Persistence
Database Fundamentals - Object-Oriented
Model
Summary
– The O-O model is more flexible for
representing natural (dynamic) objects in the
real world than the E-R model
– The O-O model provides less of an impedance
mismatch
Allows the conceptual data model and the user’s
view of the application domain to be closer to the
logical model and the system implementation
Database software...
Light Duty
Medium Duty
Heavy Duty
Database Tables
Database
Age= 55 Age= 45
Attribute
Attribute
The Relational Model
ER-DIAGRAM : example
Jen_Gunaan Na_Jalan
Lebar
Jen_Bangunan Id Panjang
Na_Jalan
LOT bersebelahan JALAN Laluan
Polygon G T Line G
Risiko
1 T
Kelas
No_Rumah
bersebelahan
bersebelahan
berdekatan
ID m Tekanan
No_PB
PARIT PILI BOMBA
Point G Trkh_Servis
Polygon G Lokasi
T T
Na_Jln Status
Zon Taraf
E-R Diagram
Schema
The structure of a database described in a
formal language.
Generally stored in the data dictionary.
The term is often used to refer to a graphical
depiction of the database structure.
In a RDBMS, the schema defines the tables,
the fields in each table, and the relationships
between fields and tables.
Example..Schema
PENGUNDI
No_KP Taraf Nama Kawasan Kerja
PEKERJAAN
No_KP Kerja Gaji Tempat Status
AKAUN
No_Akaun Bank Cawangan No_Kp ID_Sec
Fields and Records
Field: An element
First Name Last Name
of a table that
contains a specific 1 Amanda Huginkiss
item of
2 I.P. Freely
information;
Record: A 3 Al Coholic
collection of data 4 Ivona Tinkie
about a person, an
event, etc.
RDBMS (Relational DBMS)
a type of database management
system(DBMS) that stores data in the form
of related tables.
Why RDBMS?
Relational databases are powerful because
they require few assumptions about how data
is related or how it will be extracted from the
database.
As a result, the same database can be viewed
in many different ways.
A single database can be spread across
several tables.
Relational Database
Relations
Keys
• Candidate Keys
• Primary Keys
• Alternate Keys
Foreign Keys
A foreign key on relation A is a primary key on relation B.
What are attribute data?
“Positional data are the ‘where things are’ data
and attribute data the ‘what things are’ ”.
• dates (10012001)
Database implementation
is the procedure of
populating the database
with attribute data.
The Design Process of Database
Needs Analysis
Data investigation is the “fact-finding” stage of database creation.
Consider:
• data types
• data quantity
• data quality
• attribute nature
• entity nature
Conceptual Design:
Modeling the Relationships between
Entities
GPS Negeri
GPS_Stn
Seksyen 1 Koordinat
Mukim Daerah WGS_Lat
1
Geosentrik
WGS_Lon
Control Monumen
R_East
R_North RSO_X RSO_Y
CCDB_Stn Status
GPS_Stn
1 1 CCDB_Stn
Tarikh
Update
Koordinat
Pointkey Geodetik WGS_Lat
1 Kawalan 1
Divide to
Coincide WGS_Lon
Kadaster R_North RSO_X
R_East RSO_Y
Negeri
Pelan_Lokasi M 1
Control Negeri
GPS_Stn
Seksyen 1 Geocentric
Mukim Daerah WGS_Lat
1
Coordinates
WGS_Lon
Control Monumen
R_East
by R_North RSO_X RSO_Y
CCDB_Stn Status
GPS_Stn
1 1 CCDB_Stn
Tarikh Geodetic
Update
Pointkey Coordinates WGS_Lat
1
Cadastral 1
Divide to
Coincide WGS_Lon
Cadastre R_North RSO_X
R_East RSO_Y
Negeri
Pelan_Lokasi M 1
STO LOT
BRY
-NEGERI
-POINTKEY (Primary Key)
-APDATE -DAERAH
-APDATE
-PARCELKEY -MUKIM
-MARK_DESC
-BEARING -SEKSYEN
-SERIAL -LOT
-DISTANCE
-COORD_TYPE -SVY_AREA
-UNITS
-R_EAST -CLASS -AREAUNIT
-R_NORTH -LINE_CODE -APDATE
- S_COMMENT -LINE_TYPE -STATUS
-STATUS -ENTRY_MOD -LOCK_ID
-GID -PLAN -GID
-FNODE
-TNODE
-ADJPARCEL
-STATUS
FIELD FOR TABLE
CCDBgeodCCDBgeod
GPSgeod -OBJECT_ID
-OBJECT_ID -CCDB_STN (Foreign
Key)
-GPS_STN (Foreign Key)
-WGS_LAT
-WGS_LAT
-WGS_LON
-WGS_LON
-RSO_Y
-RSO_Y
-RSO_X
-RSO_X
-R_NORTH
-R_NORTH
-R_EAST
-R_EAST
CCDBgeos
GPSgeos
-OBJECT_ID
-OBJECT_ID
-CCDB_STN (Foreign
-GPS_STN (Foreign Key) Key)
-WGS_LAT -WGS_LAT
-WGS_LON -WGS_LON
-RSO_Y -RSO_Y
-RSO_X -RSO_X
-R_NORTH -R_NORTH
-R_EAST -R_EAST
Physical Design
Frequently • equal to ( = )
• not equal to ( != )
Boolean Operators
Connectors
And
Or
Not
Xor (Exclusive Or)
Aspatial
– questions about the attributes of features
– can be performed by database software alone
prompts and query builder
Spatial
– answers the question, “Where is something?”
– associated with location; distances, areas,
perimeters
– usually presented in map form; computer screen
SQL: Example
Here is a simple query that displays data from
Table1:
– SELECT Table1.[First Name], Table1.[Last Name]
– FROM Table1
– ORDER BY Table1.[First Name];
This will generate a query that shows the fields First
Name and Last Name from Table1, ordering them
by the First Name.
SQL Continued
This language can get quite complicated:
– SELECT DISTINCTROW
Customers.CustomerID,
Customers.CompanyName, Customers.City,
Customers.Country
– FROM Customers RIGHT JOIN Orders ON
Customers.CustomerID = Orders.CustomerID
– WHERE (((Orders.OrderDate) Between
#1/1/95# And #12/31/95#));