ESSENCEOFDBASE/PPT/0604/1.0
Icons used
Questions References
Key Concepts
Demo
Brain Teasers
A Welcome Break
Module Information
Module Description This module provides students with the basic knowledge and skills that are needed to understand the need for databases and how they can design them
Level Prerequisites
Module Outline
Module Flow:
1.
What is a Database System
2.
Types of Database Systems
3.
Creating a Database Environment
4.
Structured Query Language
5.
Internal Management
6.
Database Trends
10
11
DBMS Architecture
Internal Schema : Describes physical storage structure of database Conceptual Schema : Describes structure whole database for community of users. External Schema : of a
Each view describes that part of database that a particular user requires, and hides the rest.
Copyright 2005, Cognizant Academy, All Rights Reserved 14
DBMS Architecture
Data Independence
Logical
schema.
data
independence
capacity
to
change
15
Functions of DBMS
Data definition: Specifies content and structure of database and defines each data element Data manipulation: Manipulates data in a database Data security and integrity: Monitors user requests and rejects any unauthorized attempts Data recovery and concurrency: Enforces certain controls for recovery and concurrency Data dictionary: Stores definitions of data elements, and data characteristics Performance: Functions should be performed efficiently
16
Requirements of a DBMS
Key elements in a database environment: Data Administration Data Planning and Modeling Methodology Database Technology Management Users and
17
Quiz
If a Customer Database has the following fields : EmpId, EmpName, Salary and DeptName, What would be the ideal Key field and why ? EmpID EmpName DeptName EmpId+DeptName
19
20
21
22
JOIN
SELECT PROJECT
Copyright 2005, Cognizant Academy, All Rights Reserved 23
24
Network DBMS
Depicts data logically as many-to-many relationships Organizes data in tables and views relationships as links It is also a pointer based model Organizes data in arbitrary graphs
25
26
Object-Oriented Databases
Object-oriented DBMS: Stores data and procedures as objects that can be retrieved and shared automatically Object-relational DBMS: Provides capabilities of both objectoriented and relational DBMS
27
28
29
needs of an organization
Why Data Modeling is important? Cannot build a good system without knowing what data needs to be
30
31
E-R Modeling
Originally proposed by Peter Chen (1976) Views the real world as entities and relationships
32
33
E-R Modeling
Entity
has
works for
Identifier
Relationship
Attributes
34
E-R Modeling
Entity
Any object or thing of significance about which data needs to be collected
and maintained
Could be Concrete or tangible like a person or a building
Abstract like a concept or activity
35
E-R Modeling
Entity Rules
Any thing or object may only be represented by one entity. Entities are
E-R Modeling
Entity Classification and Types
Fundamental entity - An entity that exists and is of interest in its own right.
many-many relationship
Sub-type/super-type- Used in generalization hierarchies to represent a subset of instances of their of parent entity
37
E-R Modeling
Example of Associative entity :
ORDER
has belongs to
ORDER LINE
for a appears on
ITEM
38
E-R Modeling
Generalization Hierarchies
Generalization occurs when two or more entities represent categories of the same real-world object.
39
E-R Modeling
Generalization Hierarchies
Form of abstraction that specifies that two or more entities that share common attributes can be generalized into a higher level entity type called a super-type or generic entity. The lower-level of entities become the sub-type, or categories, to the super-type. Sub-types are dependent entities.
40
E-R Modeling
Generalization Hierarchies Sub-types can be either mutually exclusive (disjoint) or overlapping (inclusive) In an overlapping hierarchy an entity instance can be part of multiple subtypes
Example: Entity PERSON represents people at a university. It has three subtypes, FACULTY, STAFF, and STUDENT. A STAFF member could also be registered as a STUDENT
PERSON
STUDENT
STAFF
FACULTY
41
E-R Modeling
Generalization Hierarchies
In a disjoint hierarchy, an entity instance can be in only one subtype.
Example: Entity EMPLOYEE, may have two subtypes, CLASSIFIED and WAGES. An employee may be one type or the other but not both
42
E-R Modeling
Generalization Hierarchies - Nested
PERSON
STUDENT
FACULTY
UNDERGRAD
GRADUATE
43
E-R Modeling
Attribute
Attributes describe a property or a characteristic of an entity
FName MI
Name
LName Composite
44
E-R Modeling
Attribute Classification
Single-valued attribute Has exactly one value per instance of an entity Multi-valued attribute Contains repeating values per instance of an entity
Math
Physics
45
E-R Modeling
Identifiers and Descriptors Attributes can be classified as identifiers or descriptors
Identifiers, more commonly called keys, uniquely identify an
instance of an entity.
A descriptor describes a non-unique characteristic of an entity instance. An Example : Entity: Employee Unique Identifier: Employee No. Descriptor: Name, DOJ, DOB
46
E-R Modeling
Relationship
Represents an association between two or more entities
Examples
- Employees work for Departments
- Departments manage one or more projects - Employees are assigned to projects - Projects have sub-tasks - Orders have line items
- Cardinality
- Direction - Type - Existence
Copyright 2005, Cognizant Academy, All Rights Reserved 47
E-R Modeling
Degree
Number of entities associated with the relationship
Connectivity
Mapping of associated entity instances in the relationship.
The values of connectivity are "one" or "many.
Cardinality
Actual number of related occurrences for each of the two entities.
48
E-R Modeling
Connectivity and Cardinality
A one-to-one (1:1) relationship is when at most one instance of a entity A Is
unique employee.
A one-to-many (1:N) relationships is when for one instance of entity A, there are zero, one, or many instances of entity B, but for one instance of entity B, there is only one instance of entity A.
An example :
A department has many employees each employee is assigned to one department
49
E-R Modeling
Connectivity and Cardinality
A many-to-many relationship, is when for one instance of entity A,
there are zero, one, or many instances of entity B and for one
instance of entity B there are zero, one, or many instances of entity A.
An example is: employees can be assigned to no more than two projects at the same time; Project must have assigned at least three employees
50
E-R Modeling
Direction
Indicates the originating entity of a binary relationship. The entity from
which a relationship originates is the parent entity; the entity where the
relationship terminates is the child entity.
Type
The direction of a relationship is determined by its connectivity.
51
E-R Modeling
Existence
Denotes whether the existence of an entity instance is dependent upon the existence of another, related, entity instance. Defined as either mandatory or optional.
52
E-R Modeling
E-R Notation
No standard notation
53
E-R Modeling
Entities
Represented by labeled rectangles The label is the name of the entity Entity names should be singular nouns.
Relationships
Represented by a solid line connecting two entities. Name written above the line Relationship names should be verbs
Employee
Works for
Department
54
E-R Modeling
Attributes
Listed inside the entity rectangle Underlined Names should be singular nouns
Employee
EmpID EmpName
Cardinality
Many is represented by a line ending in a crow's foot. If omitted, cardinality is one
Existence
Represented by placing a circle or a perpendicular bar on the line Mandatory existence is shown by the bar next to the entity for an instance that is required Optional existence is shown by placing a circle next to the entity that is optional
55
Specific vendor. A PO has one or more line items. A buyer cannot create a PO of
Total value more than his approval limit. A PO can be sent to the vendor by mail, fax, EDI. A PO can be canceled before it is submitted. A PO can be linked to a sales order
Copyright 2005, Cognizant Academy, All Rights Reserved 56
E-R Modeling
Step 1: Identify Entities
Entities
Purchase Order (PO) Buyer? Vendor Line Items Sales Order Approval Limit?
57
E-R Modeling
Step 2: Identify Relationships
Look for phrases describing a link between two things or objects
58
E-R Modeling
Step 2: Identify Relationships Grid Technique
PO PO Buyer replaced by creates a Buyer is approver of Vendor
Vendor Line
Line -
59
E-R Modeling
Step 2 : Identify Relationships
Analyzing Existing Systems (Files, Databases)
Structured Codes
All of the above imply relationships
60
E-R Modeling
Step 3 : Identify Attributes An attribute is any detail that server to identify, classify, quantify or
express the the state of an entity Ask the following question for each entity What information do you need
61
E-R Modeling
Step 3: Identify Attributes
Example Purchase Order Form
Purchase Order No __________ Buyer _________ Vendor ___________ Date Created ______
Purchase Order No
Vendor Buyer Date Created Item? Address City State Zip Total Value?
62
No Item Quantity Value ___ ___________ ______ __________ ___ ___________ ______ __________ ___ ___________ ______ __________ Shipping Address Street _________ City __________ Total Value ______ Zip _______
E-R Modeling
E-R Model of the Purchase Order Example
creates
BUYER
created for a
PURCHASE ORDER
created by
has
exists on
ITEM LINE
created for
63
E-R Modeling
Major Modeling Techniques Peter Chens original entity/relationship diagrams Information Engineering Richard Barkers notation, used by Oracle corporation IDEF1X Object Role Modeling Unified Modeling Language (UML) Extensible Markup Language (XML)
64
E-R Modeling
Major Modeling Techniques
Data Modeling has sets of two audiences:
User community - Uses the models to verify that the analysts understand their environment and their requirements. Systems designers - Use the business rules implied by the models as the basis for their design of computer systems.
65
Relational Model
Objective :
To give an informal introduction to relational concepts especially as they
What it is not ?
This does not give a complete description of relational theory.
66
Relational Model
Formally introduced by Dr. E. F. Codd in 1970 Represents data in the form of two-dimension tables A relational database is a collection of two-dimensional tables Basic understanding of the model needed to design and use relational databases
67
Relational Model
Tables, Columns and Rows Relationships and Keys
Data Integrity
Normalization What is a table?
Represents some real-world person, place, thing, or event Two-dimensional
Columns Rows
Course No. CIS 120 MKT 333 ECO 473 BA201 CIS 345
Course_Title Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase
Relational Model
Table
Columns represent a property of the person, place, thing or event that the table represents Rows represent an occurrence or instance of what the table represents A data value is stored in the intersection of a row and column Each named column has a domain, which is the set of values that may appear in that column
Empid Name Level
M3 M4
DOJ
4/10/98 1/23/01
Manager
101667 101412
Employee
101398 Mike
101667 Jeff 103893 Cindy 101116 Rahul 102739 Scott
S1
M2 M3 S2 C1
8/15/95
6/2/96 7/17/95 2/20/00 4/13/01
101667
100351 101284 101412 101667
69
Relational Model
Table - Terminology
In this document
Formal Terms
Table
Relation
Table
Column
Attribute
Field
Row
Tuple
Record
70
Relational Model
Salient features of a relational table Values are atomic (1NF)
Column values are of the same kind (Domain)
Each Row is unique (Primary Key) Sequence of columns is insignificant Sequence of rows is insignificant
71
Relational Model
Primary Key Column or a set of columns that uniquely identify a row in a table
Must be unique and must have a value
Foreign Key Column or set of columns which references the primary key or a
unique key of another table Rows in two tables are linked by matching the values of the foreign key in one table with the values of the primary key in another
EMP_ID in table EMPLOYEE is the primary key DEPT_NO in table DEPARTMENT is the primary key DEPT_NO in table EMPLOYEE is a foreign key Examples
72
Relational Model
Data Integrity Ensures correct and consistent navigation and manipulation of
relational tables
Two types of integrity rules
The entity integrity rule states that the value of the primary key can
never be a null value The referential integrity rule states that if a relational table has a foreign key, then every value of the foreign key must either be null or match the
values in the relational table in which that foreign key is a primary key
73
Relational Model
Data Manipulation Relational tables are equivalent to sets
Operations that can be performed on sets can be performed
on relational tables Relational Operations such as :
INTERSECTION UNION
Relational Model
Selection The select operator, sometimes called restrict to prevent confusion with
the SQL SELECT command, retrieves subsets of rows from a relational table based on a value(s) in a column or columns
A
1 2 3 4 5 6 7
B
A C B D C A B
C
212 45 8656 324 5656 445 546
D
Y N N N Y N Y
E
2 84 4 56 34 4 55
75
Relational Model
Projection The project operator retrieves subsets of columns from a relational table
removing duplicate rows from the result
A
1 2 3 4 5 6 7
B
A C B D C A B
C
212 45 8656 324 5656 445 546
D
Y N N N Y N Y
E
2 84 4 56 34 4 55
76
Relational Model
Product
The product of two relational tables, also called the Cartesian Product, is the concatenation of every row in one table with every row in the second. The product of table A (having m rows) and table B (having n rows) is the table C (having m x n rows). The product is denoted as A X B or A TIMES B ak k x
A B C
ax
A A A B B B C C C
ay
2 2 2 4 4 4 6 6 6
bk
1 4 5 1 4 5 1 4 5
bx
A D E A D E A D E
by
2 8 10 2 8 10 2 8 10
77
y
2 4 6
Table A
1 1 1 2 2 2 3 3 3
1 2 3
A TIMES B
k
Table B
1
4 5
x
A
D E
y
2
8 10
Relational Model
Join
Combines the product, selection and projection operations Combines (concatenates) data from one row of a table with rows from another or same table Criteria involve a relationship among the columns in the join relational table
If the join criterion is based on equality of column value, the result is called an equi join A natural join is an equi join with redundant columns removed Joins can also be done on criteria other than equality. Such joins are called non-equi joins
k
1
a
A
b
2
k Table B k
1 3 5
a
A
b
2
k
1
c
aa
Equi-Join
2
3
B
C
4
6
c
aa bb cc
bb
k Natural Join 1
3
a
A C
b
2 6
c
aa bb
78
Table A
Relational Model
Union
The UNION operation of two tables is formed by appending rows from one table to those of a second to produce a third. Duplicate rows are eliminated Tables in an UNION operation must have the same number of columns and corresponding columns must come from the same domain A Union B
k
1 2 3
x
A B C
y
2 4 6
k
1
x
A B C D E
y
2 4 6 8 10
Table B
Table A
k
1 4 5
x
A D E
y
2 8 10
3 4 5
79
Relational Model
The UNION operation of two tables is formed by appending rows from one table to those of a second to produce a third. Duplicate rows are eliminated Tables in an UNION operation must have the same number of columns and corresponding columns must come from the same domain A Union B
k
1 2 3
x
A B C
y
2 4 6
k
1
x
A B C D E
y
2 4 6 8 10
Table B
Table A
k
1 4 5
x
A D E
y
2 8 10
3 4 5
80
Relational Model
Intersection The intersection of two relational tables is a third table that contains
common rows. Both tables must be union compatible. The notation for the intersection of A and B is A [intersection] B = C or A INTERSECT B A Intersect B k
1 2 3
x
A B C
y
2 4 6
k Table A
1 4 5
x
A D E
y
2 8 10
k
1
x
A
y
2
Table B
81
Relational Model
Difference The difference of two relational tables is a third that contains those
rows that occur in the first table but not in the second. The Difference
operation requires that the tables be union compatible.
The notation for difference is A MINUS B or A-B. As with arithmetic, the order of subtraction matters. That is, A - B is not the same as B - A.
k
1 2 3
x
A B C
y
2 4 6
A MINUS B Table A
k
2 3
x
B C
y
4 6
k
1 4 5
x
A D E
y
2 8 10
Table B
B MINUS A
k
4 5
x
D E
y
8 10
82
Relational Model
Division The division operator results in columns values in one table for which
there are other matching column values corresponding to every row in another table. k
1 1 2 3 4 3
x
A B A B B A
y
2 4 2 4 4 2 B 4
k
1 3
x
A
y
2
A DIV B
Table A
Table B
83
Normalization
Normalization theory is based on the concepts of normal forms. A relational table is said to be a particular normal form if it satisfied a certain set of constraints.
We shall discuss four normal forms in this Module.
84
Normalization
Un normalized Relation Remove repeating groups
Boyce/Codd NF
85
Normalization
An Example : A company obtains parts from a number of suppliers. Each supplier is located in one city. A city can have more than one supplier located there and each city has a status code associated with it. Each supplier may provide many parts.
The company creates a simple relational table to store this information: FIRST (s#, status, city, p#, qty) s# status City p# Qty Supplier identification number Status code assigned to city City where supplier is located Part number of part supplied Qty of parts supplied to date
86
Normalization
FIRST NORMAL FORM 1NF
A relational table is said to be in the first normal form if all values of the columns are atomic. That is, they contain no repeating values.
s#
s1 s1 s1
city
London London London
status
20 20 20
p#
p1 p2 p3
qty
300 100 200
s1
s2 s2 s3 s3
London
Paris Paris Tokyo Tokyo
20
10 10 30 30
p4
p1 p3 p2 p4
100
250 100 300 200
87
Normalization
88
Normalization
A relational table is in second normal form 2NF if it is in 1NF and every non-key column is fully dependent upon the primary key. That is, every non-key column
Normalization
SECOND NORMAL FORM 2NF
PARTS s#
s1 s1 s1 s1 s2 s2 s3 s3
p#
p1 p2 p3 p4 p1 p3 p2 p4
qty
300 100 200 100 250 100 300 200 s1 s2 s3
SECOND s# city
London Paris Tokyo
status
20 10 30
90
Normalization
SECOND NORMAL FORM 2NF
Modification Anomalies Tables in 2NF but not in 3NF still contain modification anomalies: INSERT. The fact that a particular city has a certain status (Rome has a status of 50) cannot be inserted until there is a supplier in the city. DELETE. Deleting any row in SUPPLIER destroys the status information about the city as well as the association between supplier and city.
91
Normalization
THIRD NORMAL FORM 2NF
A relational table is in third normal form (3NF) if it is already in 2NF and every non-key column is non transitively dependent upon its primary key.
In other words, all non-key attributes are functionally dependent only upon the primary key.
SUPPLIER s#
s1
s2 s3 s4
city
London
Paris Tokyo Paris
status
20
10 30 10
The table supplier is in 2NF but not in 3NF because it contains a transitive dependency SUPPLIER.s# > SUPPLIER.city SUPPLIER.city > SUPPLIER.status SUPPLIER.s# > SUPPLIER.status
92
Normalization
Steps for transforming a table into 3NF is: 1. Identify any determinants, other the primary key, and the columns they determine. 2. Create and name a new table for each determinant and the unique columns it determines. 3. Move the determined columns from the original table to the new table. The determinant becomes the primary key of the new table.
SUPPLIER
s1 The transformation of SUPPLIER into 3NF s2 s3 s4 s5
s#
city
London Paris Tokyo Paris London
CITY_STATUS city
London Paris Tokyo Rome
status
20 10 30 50
93
Normalization
Advantages of 3rd Normal form : Eliminates redundant data which in turn saves space and reduces manipulation anomalies.
INSERT: Facts about the status of a city, Rome has a status of 50, can be added even though there is not supplier in that city. DELETE: Information about supplier can be deleted without destroying information about a city. UPDATE: Changing the location of a supplier or the status of a city requires modifying only one row.
Example:
s#
s1 The transformation of SUPPLIER into 3NF s2 s3 s4
city
London Paris Tokyo Paris London
CITY_STATUS city
London Paris Tokyo Rome
status
20 10 30 50
94
SUPPLIER
s5
Normalization
Advanced Forms :: BOYCE CODD NORMAL FORM Many practitioners argue that placing entities in 3NF is generally sufficient because it is rare that entities that are in 3NF are not also in 4NF and 5NF. The advanced forms of normalization are: Boyce-Codd Normal Form
Database Design
This section presents and discusses
How to translate the E-R (conceptual) model (diagram) to an RDBMS (logical) schema. Exercise on E-R Modeling and Database Design
Some Guidelines Entities: Create one table for each simple (not a sub-type or supertype) entity. Attributes: Map each attribute to a candidate column with a more precise format. Optional attributes become null columns Mandatory attributes become not null columns Unique Identifier: Convert the components of the unique identifier to the primary key of the table.
Copyright 2005, Cognizant Academy, All Rights Reserved 96
Database Design
Sub-types: A sub-type entity is simply an entity with its own attributes or relationships, but it also inherits any attributes and/or relationships from its
Database Design
A few comments
There are more rules, treating exceptions, but these are good enough in most cases There may occur reasons to violate the rules. Always: use common sense and expect iterative development. Use CASE tools like ERWin wherever possible. Tools can automatically generate SQL table definitions from drawn E-R diagrams.
98
Develop an E-R model and database schema for a system to handle purchase orders.
99
100
101
An Introduction
Structured Query Language - (SQL) is the most widely used commercial relational database language. The SQL has several parts :
DML The Data Manipulation Language (DML) DDL The Data Definition Language (DDL) Embedded and dynamic SQL Security Transaction management Client-server execution and remote database access
102
Query Processing
Query Processing
Query in a High Level Language (typically a 4 GL)
Parsing : The parser converts a query, submitted by a database user and written in a high-level language, into an algebraic operators expression.
Optimization : It is the key Topic for query processing design. It receives the expression and builds a good execution plan. The plan determines the order of execution of the operators and selects suitable algorithms for implementation of the operators. Code Generation for the Query : The planned code is built with the aim of retrieving the result of the query with high performance. Code execution by Database Processor : The query plan is executed by the execution engine Topic that delivers the result for the user. Result of the Query
103
Query Processing
Conditional Selection
137 150
Copyright 2005, Cognizant Academy, All Rights Reserved
22.50 6.00
104
Query Processing
The SQL Select Statement performs three Types of Operations
1. Projection
105
Performing Projection
SELECT Module_Title, C_Hrs FROM Module
Module
Course No. CIS 120 MKT 333 ECO 473 BA201 CIS 345 Course_Title Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase C_Hrs. Dept. C 4 3 3 5 4 Cis MKT ECO ECO CIS
Result Table
Course_Title Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase C_Hrs. 4 3 3 5 4
106
Course No. CIS 120 MKT 333 ECO 473 BA201 CIS 345
Course Title Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase
Module
Result Table
107
Module
Course_No CIS 120 MKT 333 ECO 473 BA201 CIS 345 Course_Title Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase C_ Hrs. Dept_C 4 3 3 5 4 CIS MKT ECO ECO CIS
Result Table
Course_Title Intro to CIS Intro to Dbase C_ Hrs. 4 4
108
109
Joining Tables
Joining Tables
To appropriately join tables, the tables must be related and we apply a where clause which equates the primary key column of the table on the one side of the relationship with the parallel foreign key column of the many side table.
This type of join is called an Equi-join. Our example will join Modules and departments where dept_code is the linking key column.
The next series of slides takes you through a step by step process of combining data rows from one table with data rows in another table.
The first slide introduces the SQL Select statement the shows the join operation and a picture of the two tables that the join will operate on.
The next slides show progressive steps in the join process.
Copyright 2005, Cognizant Academy, All Rights Reserved 110
Joining Tables
Joining Two Tables - Select and Tables
SELECT * FROM Module C, department D WHERE D.Dept_Code = C.Dept_Code
Module
Course_No
CIS 120 MKT 333 ECO 473 BA201 CIS 345
Course_Title
Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase
C_Hrs Dept_Code
4 Cis 3 MKT 3 ECO 5 ECO 4 CIS
Department
SQL will compare every row of the 1st table with the first row of the 2nd table. Then it will compare all rows of the 1st with the second row of the second, and so on only rows where the condition is met are placed in the result table.
Dept Code MKT CIS ECO Dept name Office# Marketing 244 Comp. Info. Sys. 302 Economics 244
111
Joining Tables
Joining Two Tables - Row 1 Module to Row 1 Dept
SELECT * FROM Module C, department D WHERE D.Dept_Code = C.Dept_Code
Course_No
CIS 120 MKT 333
Course_Title
Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase
C_Hrs Dept_Code
4 CIS 3 MKT 3 ECO 5 ECO 4 CIS
Module
Department
Dept Code MKT CIS ECO Dept name Office# Marketing 244 Comp. Info. Sys. 302 Economics 244
RESULT TABLE
Course_No Course_Title C_Hrs Dept_Code Dept_Name Office#
112
Joining Tables
Joining Two Tables - Row 1 Module to Row 2 Dept
SELECT * FROM Module C, department D WHERE D.Dept_Code = C.Dept_Code Match on condition causes a result row to be produced.
Course_No CIS 120 MKT 333 ECO 473 BA201 CIS 345
Course_Title Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase
Module
Department
Dept Code MKT CIS ECO Dept name Office# Marketing 244 Comp. Info. Sys. 302 Economics 244
RESULT TABLE
Course_No CIS 120 Course_Title Intro to CIS C_Hrs Dept_Code Dept_Name Office# 4 Cis Comp. Info S 302
113
Joining Tables
Joining Two Tables - Row 1 Module to Row 3 Dept
SELECT * FROM Module C, department D WHERE D.Dept_Code = C.Dept_Code
Course_Title Intro to CIS Intro to Mkting Labor Econ. Intro to Stat. Intro to Dbase
Department
Dept Code MKT CIS ECO Dept name Office# Marketing 244 Comp. Info. Sys. 302 Economics 244
Module
RESULT TABLE
Course_No CIS 120 Course_Title Intro to CIS C_Hrs Dept_Code Dept_Name Office# 4 Cis Comp. Info S 302
114
115
Input output of data and memory management is managed by the Operating system
File manager Disk manager
DBMS File Request
DBMS/Host inter-com
File Manager
Disk Manager
116
Intercommunication
DBMS/Host communication :
A file is a collection of pages. A page is a unit of Input Output. The DBMS sends a file request to the file manager. The file manager has no idea where the requested page is physically stored. The file manager in turn communicates with the disk manager. The file manager provides the database system with the given page. The database system converts the same into a logical form as understandable by the user.
117
Hashing
Hashing is directly determining a page address for a given record without the overhead of creating indexes. The main problem associated with hashing are overflow & underflow.
Clusters
Physically storing related pages in the form of intra file subsets. Inter file clustering to store records from distributed databases in the same physical page.
118
119
Data mining
Aware of the business needs that require data to be analyzed in multiple dimensions
120
121
Types of databases
Major Types of Databases
Databases
Centralized database
Used by single central processor or multiple processors in client/server network
disk
CPU
Tape Drive
Disk Controller
123
Distributed database
Stored in more than one physical location
Partitioned database Duplicated database
124
Supports manipulation and analysis of large volumes of data from multiple dimensions/perspectives
125
Data warehouse
Supports reporting and query tools Stores current and historical data
126
Data warehouse
Data mart
Subset of data warehouse
Contains summarized or highly focused portion of data for a specified function or group of users
Data mining
Tools for analyzing large pools of data
127
128
129
130
131
Book
Book Book Book
132
Database Fundamentals