lesson overview 3.1 components of the dbms 3.1 components of the dbms 3.2 components of the database...
TRANSCRIPT
Lesson OverviewLesson Overview
3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database 3.2 Components of The Database
Application Application 3.3 The Three Level Architecture3.3 The Three Level Architecture 3.4 The Data Communications Manager3.4 The Data Communications Manager 3.5 The Database Administrator3.5 The Database Administrator 3.6 Client Server Architecture3.6 Client Server Architecture 3.7 Data Models3.7 Data Models
Components of The DBMSComponents of The DBMS
The DBMS consists of of the following The DBMS consists of of the following components:components:
1.Schemas and Subschemas1.Schemas and Subschemas 2.The Data Definition Language (DDL)2.The Data Definition Language (DDL) 3.The Data Manipulation Language (DML)3.The Data Manipulation Language (DML) 4.The Host Language Interface4.The Host Language Interface 5.The Query Language5.The Query Language 6.The Data Dictionary6.The Data Dictionary
3.1.1 Schemas and Subschemas3.1.1 Schemas and Subschemas The The schema schema is the overall is the overall
logical structure of a database.logical structure of a database. It is the global plan that controls It is the global plan that controls
the organisation and use of the organisation and use of data.data.
A schema can also be viewed A schema can also be viewed as a logical representation of the as a logical representation of the physical database.physical database.
It gives a complete description It gives a complete description of all records, fields, and data of all records, fields, and data relationshipsrelationships
3.1.1 Schemas and 3.1.1 Schemas and SubschemasSubschemas
The schema describes the The schema describes the
structure of the database to the structure of the database to the
DBMS.DBMS.
It also describes the application It also describes the application
processing need of the processing need of the
organisationorganisation
Schema-DiagramSchema-Diagram
A displayed schema is a schema diagram.A displayed schema is a schema diagram.
NameName StudNoStudNo ClassClass MajorMajor
STUDENTSTUDENT
CourseNameCourseName CourseNoCourseNo CreditHoursCreditHours DepartmentDepartment
COURSECOURSE
Schema DiagramSchema Diagram
CourseNoCourseNo PrerequisiteNoPrerequisiteNo
PREREQUISITEPREREQUISITE
SectIdSectId CourseNoCourseNo SemesterSemester YearYear InstructorInstructor
StudNoStudNo SectIdSectId GradesGrades
GRADESGRADES
SECTIONSECTION
3.1.1 Schemas and 3.1.1 Schemas and SubschemasSubschemas
A subschema is a subset of a A subschema is a subset of a schema.schema.
It is the functional database or It is the functional database or the user’s view of the database.the user’s view of the database.
When a user requests for a When a user requests for a record, this is expressed in record, this is expressed in terms of the functional terms of the functional database.database.
3.1.1 Schemas and 3.1.1 Schemas and SubschemasSubschemas
The data requested is translated The data requested is translated
from the declarations of the user from the declarations of the user
(subschema) to the declarative (subschema) to the declarative
structure of the schema.structure of the schema.
3.1.2 Data Definition 3.1.2 Data Definition Language (DDL)Language (DDL) The The Data Definition Language Data Definition Language
(DDL) describes the schema to the (DDL) describes the schema to the DBMS. DBMS.
It converts requests for data It converts requests for data generated at terminals or by generated at terminals or by application programs from the application programs from the Logical ViewLogical View, the view perceived by , the view perceived by the programmer, into the Physical the programmer, into the Physical View, the way data is actually View, the way data is actually stored in the disk.stored in the disk.
3.1.2 Data Definition 3.1.2 Data Definition Language (DDL)Language (DDL)
The DDL describes the data The DDL describes the data model in preparation for creation model in preparation for creation of a physical database.of a physical database.
3.1.3 Data Manipulation 3.1.3 Data Manipulation LanguageLanguage
The Data Manipulation Language The Data Manipulation Language (DML)is the mechanism used for (DML)is the mechanism used for retrieving data stored on the retrieving data stored on the disk.disk.
It contains statements that store, It contains statements that store, access, modify, update or access, modify, update or retrieve data.retrieve data.
There are two ways of retrieving There are two ways of retrieving data from the DBMS: data from the DBMS:
3.1.3 Data Manipulation 3.1.3 Data Manipulation LanguageLanguage 1.1. A user can enter command to A user can enter command to
the DBMS to retrieve a record or a the DBMS to retrieve a record or a piece of information from the piece of information from the database.database.
2.2. A user can have the A user can have the application program issue an application program issue an internal instruction (called an internal instruction (called an embedded statement) to the DBMS embedded statement) to the DBMS to retrieve certain data and return it to retrieve certain data and return it to the program.to the program.
The Roles of The DDL and The Roles of The DDL and DML in a DBMS EnvironmentDML in a DBMS Environment
ApplicationApplicationProgramProgram
Data modelData model
DatabaseDatabase
DBMSDBMS
DDLDDL
DMLDML
Sales UpdateSales Update
Disk FilesDisk Files
DDL : Interprets the requirements of the application program DDL : Interprets the requirements of the application program DML : Retrieves data stored on diskDML : Retrieves data stored on disk
3.1.4 Host Language Interface3.1.4 Host Language Interface
The The Host Language Interface Host Language Interface makes it possible for programs makes it possible for programs written in a high-level language written in a high-level language such as COBOL, C or Java to such as COBOL, C or Java to manipulate or access data in the manipulate or access data in the database.database.
Instructions that are part of the Instructions that are part of the DML are coded into the program DML are coded into the program and are converted by the host and are converted by the host language interface.language interface.
3.1.4 Host Language Interface3.1.4 Host Language Interface
The host language interface The host language interface acts as a link between the acts as a link between the application program and the application program and the DBMS.DBMS.
Thus, programmers do not need Thus, programmers do not need to learn a language other than to learn a language other than the DML to develop database the DML to develop database applications.applications.
The Host Language InterfaceThe Host Language Interface
Application ProgramApplication ProgramTerminalTerminal DBMSDBMSHost Language InterfaceHost Language Interface
Physical Physical DatabaseDatabase
3.1.5 Query Language3.1.5 Query Language A A Query LanguageQuery Language is an English- is an English-
language facility that allows users language facility that allows users with limited or no programming with limited or no programming language or computer experience to language or computer experience to query the database for information query the database for information via a display terminal.via a display terminal.
A user who wants a list of A user who wants a list of customers who has paid more than customers who has paid more than RM3500 for merchandise bought, RM3500 for merchandise bought, would enter the query:would enter the query:
3.1.5 Query Language3.1.5 Query Language
LIST CUSTOMER_NAME IF LIST CUSTOMER_NAME IF AMOUNT_PAID >3500.AMOUNT_PAID >3500.
The DBMS then authorises the The DBMS then authorises the search and produces a listing of search and produces a listing of all customers who had made all customers who had made such a purchase.such a purchase.
3.1.6 Data Dictionary3.1.6 Data Dictionary
The The Data DictionaryData Dictionary is the is the portion of the DBMS that stores portion of the DBMS that stores the schema, the subschema, the schema, the subschema, integrity rules, security integrity rules, security information and descriptions of information and descriptions of all data items in the database.all data items in the database.
The data dictionary stores data The data dictionary stores data about data. This is called the about data. This is called the metadatametadata..
How The DBMS WorksHow The DBMS Works
The DBMS is the software that The DBMS is the software that handles all access to the database.handles all access to the database.
A user through the application A user through the application program requests a record for program requests a record for update.update.
This requests triggers a set of This requests triggers a set of activities to be handled by the activities to be handled by the DBMS. The sequence of activities is DBMS. The sequence of activities is as follows: as follows:
How The DBMS WorksHow The DBMS Works
1.1. DBMS receives a request from DBMS receives a request from an application program to read a an application program to read a record. The program provides record. The program provides the record ID and record name the record ID and record name for processing.for processing.
2.2.DBMS inspects the external DBMS inspects the external schema for that user, the schema for that user, the conceptual schema and the conceptual schema and the storage structure definition.storage structure definition.
How The DBMS WorksHow The DBMS Works
3.3.Using the subschema and Using the subschema and schema, the DBMS determines schema, the DBMS determines the data needed by the the data needed by the application program.application program.
4.4.DBMS authorises the transfer of DBMS authorises the transfer of data from the system to the data from the system to the application program.application program.
5.5.the application program operates the application program operates on the data in the user work area.on the data in the user work area.
3.2 Components of The 3.2 Components of The Database ApplicationDatabase Application
A DB application consists ofA DB application consists of
1.1. forms - used for data entry forms - used for data entry
2.2. queries - used to query the the queries - used to query the the database to identify problems or database to identify problems or particular situations.particular situations.
3.3.reports- a formatted display of reports- a formatted display of data -displayed on the screen or data -displayed on the screen or can be printed.can be printed.
3.2 Components of The 3.2 Components of The Database ApplicationDatabase Application
menus - are used to organize menus - are used to organize the application components so the application components so that they are more accessible.that they are more accessible.
User need only select the topic User need only select the topic of the component required.of the component required.
3.2 Components of The 3.2 Components of The Database ApplicationDatabase Application Application programs can be Application programs can be
written in a language that is written in a language that is specific to the DBMS or a specific to the DBMS or a standard language that standard language that interfaces with the DBMS.interfaces with the DBMS.
Usually written by programmers, Usually written by programmers, hardware vendors or software hardware vendors or software house.house.
Microsoft Access uses a version Microsoft Access uses a version of VISUAL BASIC. of VISUAL BASIC.
3.3 The Three Levels of The 3.3 The Three Levels of The ArchitectureArchitecture
The 3-level architecture was The 3-level architecture was proposed to achieve the proposed to achieve the characteristics of the database.characteristics of the database.
The goal of this architecture is to The goal of this architecture is to separate user applications and separate user applications and the physical database.the physical database.
The 3 levels are; internal level, The 3 levels are; internal level, conceptual level and external conceptual level and external level.level.
3.3 The Three-Levels Of The 3.3 The Three-Levels Of The ArchitectureArchitecture
EXTERNALLEVEL1(individual user views)
CONCEPTUAL LEVEL(community user view)
INTERNAL LEVEL(storage view)
. . .EXTERNAL
LEVELn(individual user views)
3. 3.1 The Internal Level3. 3.1 The Internal Level
The The internal level (or internal data model or internal level (or internal data model or physical model)physical model) has an has an internal schema internal schema which describes the physical storage structure which describes the physical storage structure of the database. of the database.
The internal model shows how the data is The internal model shows how the data is internally represented in the database.internally represented in the database.
It includes the data structures and file It includes the data structures and file organisations used to store the data on hard organisations used to store the data on hard disk or other physical devices.disk or other physical devices.
3. 3.1 The Internal Level3. 3.1 The Internal Level
It describes the complete details of data It describes the complete details of data
storage and access paths for the database.storage and access paths for the database.
the internal schema is written in the internal the internal schema is written in the internal
DDLDDL
3.3.2 The Conceptual Schema3.3.2 The Conceptual Schema
The The conceptual level conceptual level (or (or conceptual data conceptual data modelmodel) has a ) has a conceptual schemaconceptual schema - defines - defines all the users’ requirements in a single all the users’ requirements in a single description. description.
It hides the details of the physical storage It hides the details of the physical storage structures and concentrates on describing the structures and concentrates on describing the structure of the entire information system structure of the entire information system structure of the database for a community of structure of the database for a community of users as seen by the database administrator . users as seen by the database administrator .
3.3.2 The Conceptual Schema3.3.2 The Conceptual Schema
Only one conceptual schema is Only one conceptual schema is maintained in a database systemmaintained in a database system
This represents the workings of the This represents the workings of the organisation.organisation.
The database administrator has access The database administrator has access to the total conceptual view.to the total conceptual view.
3.3.2 The Conceptual Schema3.3.2 The Conceptual Schema
Other database users have Other database users have partial access depending on partial access depending on their needs or predefined their needs or predefined requirements.requirements.
The conceptual schema is The conceptual schema is written in the conceptual DDLwritten in the conceptual DDL
3.3.2 The Conceptual Schema3.3.2 The Conceptual Schema
No data in the database can be No data in the database can be accessed, modified or deleted accessed, modified or deleted unless they are defined in the unless they are defined in the conceptual schema.conceptual schema.
The conceptual schema is the The conceptual schema is the basis for developing both the basis for developing both the external and internal models.external and internal models.
3.3.3 The External Schema3.3.3 The External Schema
The The external level (external level (or or view level view level or or external external data model) data model) has an has an external schema external schema or or view schema view schema which which is the users’ view of the is the users’ view of the data or of a specific application.data or of a specific application.
It is a subset of of the conceptual schema It is a subset of of the conceptual schema necessary for supporting a particular user necessary for supporting a particular user view.view.
The external schema is written in the external The external schema is written in the external DDLDDL
3.3 The Three Level 3.3 The Three Level ArchitectureArchitecture It describes the part of the database It describes the part of the database
that the user is interested in and that the user is interested in and hides the rest of the database from hides the rest of the database from the user. the user.
The three schemas are only The three schemas are only descriptions of data.descriptions of data.
The only data that actually exists is The only data that actually exists is at the physical level.at the physical level.
Each user group refers only to their Each user group refers only to their own external level.own external level.
3.3.3 Mappings3.3.3 Mappings
The three level architecture contains two The three level architecture contains two levels of mappings.levels of mappings.
The The conceptual/internal conceptual/internal mapping defines mapping defines the correspondence between the the correspondence between the conceptual view and the stored database.conceptual view and the stored database.
It specifies how conceptual records and It specifies how conceptual records and fields are represented at the internal level.fields are represented at the internal level.
3.3.3 Mappings3.3.3 Mappings
Any changes made to the Any changes made to the internal structure definition must internal structure definition must be reflected in the be reflected in the conceptual/internal conceptual/internal mapping.mapping.
An An external/conceptual external/conceptual mapping mapping defines the correspondence defines the correspondence between a particular external between a particular external view and the conceptual viewview and the conceptual view
3.4 The Data Communications 3.4 The Data Communications ManagerManager
Any database requests from a user Any database requests from a user are transmitted from the user’s are transmitted from the user’s terminal to the online application terminal to the online application and then to the DBMS in the form and then to the DBMS in the form of communication messages.of communication messages.
Any response back to the user from Any response back to the user from the DBMS and online application the DBMS and online application are also transmitted in the form of are also transmitted in the form of such messages.such messages.
The Data Communications The Data Communications ManagerManager
These message transmissions These message transmissions take place under the direction of take place under the direction of another software system, i.e. the another software system, i.e. the data communications manager data communications manager (DC manager).(DC manager).
The DC is not part of the DBMS The DC is not part of the DBMS but is an autonomous system.but is an autonomous system.
The Data Communications The Data Communications ManagerManager
The DBMS looks after the The DBMS looks after the database while the DC manager database while the DC manager handles all messages to and handles all messages to and from the DBMS.from the DBMS.
DBADBA
The database administrator (DBA) is the person The database administrator (DBA) is the person responsible for administering the database responsible for administering the database resources.resources.
The DBA The DBA Authorises access to the databaseAuthorises access to the database Coordinates and monitors the use of the Coordinates and monitors the use of the
databasedatabase Acquires the hardware and software resources Acquires the hardware and software resources
as neededas needed Is accountable for the security of the database Is accountable for the security of the database
systemsystem Manages the system in terms of response time Manages the system in terms of response time
etc.etc.
The Database AdministratorThe Database Administrator
The database administrator (DBA) The database administrator (DBA) is the person who is responsible for is the person who is responsible for the overall control of the database the overall control of the database system at a technical level.system at a technical level.
The DBA is in charge of :The DBA is in charge of : 1.1. Defining the conceptual Defining the conceptual
schemaschema 2.2. Defining the internal schemaDefining the internal schema 3.3. Lasing with usersLasing with users
The Database AdministratorThe Database Administrator
4.4. Defining security and Defining security and integrity checksintegrity checks
5.5. Defining backup and Defining backup and recovery proceduresrecovery procedures
6.6. Monitoring performance and Monitoring performance and responding to changing responding to changing requirementsrequirements
The role of a DBA is explained in The role of a DBA is explained in greater detail in Chap.6.greater detail in Chap.6.
Client/Server ArchitectureClient/Server Architecture
End Users
Clients
Server
Database
Applications
DBMS
Client/ServerClient/Server
Consists of a server (backend) and a Consists of a server (backend) and a set of clients (frontend)set of clients (frontend)
User interface and application User interface and application programs moved to the client end. programs moved to the client end.
SQL became the dividing point SQL became the dividing point between client and serverbetween client and server
Query and Transaction functions Query and Transaction functions remained in the server end remained in the server end (sometimes called query server or (sometimes called query server or transaction server)transaction server)
ServerServer The server is the DBMS. It stores the The server is the DBMS. It stores the
datadata Supports all the basic functions of the Supports all the basic functions of the
DBMS, i.e. data definition, data DBMS, i.e. data definition, data manipulation, data security and integrity manipulation, data security and integrity etc.etc.
Provides all the external, conceptual Provides all the external, conceptual and internal supportand internal support
In this context - just another name In this context - just another name for the DBMS.for the DBMS.
IN RDBMS it is called a SQL server IN RDBMS it is called a SQL server since RDBMS servers are based on since RDBMS servers are based on the SQL languagethe SQL language
ClientClient
Access the data stored in server.Access the data stored in server. Clients are all the applications and the Clients are all the applications and the
user interface that run on the DBMSuser interface that run on the DBMS I.e. user written applications and built-in I.e. user written applications and built-in
applicationsapplications Clients can communicate with the Clients can communicate with the
DBMS through Application DBMS through Application Programming Interface (API) provided Programming Interface (API) provided by the Open Database Connectivity by the Open Database Connectivity (ODBC) standard(ODBC) standard
SUMMARYSUMMARY
A database is a collection of A database is a collection of integrated files shared by many integrated files shared by many users and capable of handling users and capable of handling many applications.many applications.
A DBMS is the software that A DBMS is the software that access the information stored in access the information stored in the database.the database.
SUMMARYSUMMARY
The DBMS allows for :The DBMS allows for : data integration - pooling the data integration - pooling the
files in a central locationfiles in a central location data sharing - allowing all users data sharing - allowing all users
access through data integrationaccess through data integration minimum data duplicationminimum data duplication independence of physical file independence of physical file
format.format.
SUMMARYSUMMARY The DBMS supports 4 main The DBMS supports 4 main
types of language:types of language: The DDL is used to define the The DDL is used to define the
database schemas.database schemas. The DML is used for specifying The DML is used for specifying
database updates and database updates and retrievals.retrievals.
The Host Interface Language The Host Interface Language allows programs written in hihg-allows programs written in hihg-level language to be level language to be manipulated in the database.manipulated in the database.
SUMMARYSUMMARY The query language allows The query language allows
users to query the database for users to query the database for information.information.
The 3 level architecture is The 3 level architecture is proposed as a way of achieving proposed as a way of achieving the database characteristics of the database characteristics of data independence.data independence.
The conceptual schema defines The conceptual schema defines all the users’ database all the users’ database requirements into a single requirements into a single database descriptiondatabase description
SUMMARYSUMMARY
The external schema is the The external schema is the users’ view of the data.users’ view of the data.
The internal data model shows The internal data model shows how data is internally how data is internally represented in the database.represented in the database.
The data communications The data communications manager is the software that manager is the software that handles message transmission handles message transmission between a user and the DBMS.between a user and the DBMS.
SUMMARYSUMMARY
The database administrator is The database administrator is the person who controls the the person who controls the overall database system from a overall database system from a technical point.technical point.