Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Database Language and Interfaces

By
Muhammad Usman
Database Language
 Data definition language (DDL)
• Defines both schemas
 Storage definition language (SDL)
• Specifies the internal schema
 View definition language (VDL)
• Specifies user views/mappings to conceptual
schema
 Data manipulation language (DML)
• Allows retrieval, insertion, deletion, modification
Database Language
 Once the design of the database is completed and a DBMS is chosen to
implement the database, the first step is to specify conceptual and
internal schemas for the database and any mappings between the two.
 In many DBMS where no strict separation of level is maintained, one
language called the “Data definition language” is used by the DBA
and the database designer to define both the schema(conceptual and
internal).
 The DBMS will have a DDL compiler whose function is to process
DDL statements in order to identify the description of the schema
construct and to store the schema description in the DBMS catalogue.
Database Languages (cont.)
 In DBMS where a clear separation is maintained between the conceptual
and internal levels. The DDL is used to specify the conceptual schema
only.
 Another language, the storage definition language (SDL), is used to
specify the internal schema.
 For a true three-schema architecture, we would need a third language,
the view definition language (VDL),to specify user views and their
mappings to the conceptual schema.
 In most DBMSs the DDL is used to define both conceptual and external
schemas.
 In relational DBMSs, SQL is used in the role of VDL to define user or
application views as results of predefined queries
Database Languages (cont.)
 Once the database schema are compiled and the database is populated
with data, user must have some means to manipulate the database
(insertion, deletion and modification).
 The DBMS provide a set of operation or a language called the “Data
Manipulation Language”.
 There are two type of DML languages:

 High Level or Nonprocedural Language.


 Low Level or Procedural Language.
DML- Data Manipulation Language.
 High Level or Nonprocedural:
 This kind of DML is to specify the complex database operations
concisely.

 Low Level or Procedural:


 Low level DML must be embedded in a general-purpose programming
language. This types of DML typically retrieves individual records from
the database and process each separately.
Database Interfaces
Menu Based Interfaces and Web Clients or Browsing
 These interfaces provide the user with the lists of options called
(menus).
 Pull down menus are very popular technique in Web-based Interfaces.
 Lead user through formulation of request
 Query is composed of selection options from menu displayed by system.
Database Interfaces
 Forms-Based Interfaces
 Displays a form to each user.
 User can fill out form to insert new data or fill out only certain entries.
 Designed and programmed for naïve users as interfaces to canned transactions.

 Graphical User Interfaces
 Displays a schema to the user in diagram form.
 The user can specify a query by manipulating the diagram.
 GUIs use both forms and menus.
Database Interfaces
 Natural Language Interfaces
 Accept requests in written English, or other languages and attempt to understand them.
 Interface has its own schema, and a dictionary of important words. Uses the schema
and dictionary to interpret a natural language request.

 Interfaces for Parametric Users
 Parametric users have small set of operations they perform.
 Analysts and programmers design and implement a special interface for each class of
naïve users.
 Often a small set of commands included to minimize the number of keystrokes
required. (I.e. function keys)

Database Interfaces

 Interfaces for the DBA


 Systems contain privileged commands only for DBA staff.
 Include commands for creating accounts, setting parameters, authorizing accounts,
changing the schema, reorganizing the storage structures etc.
The Database System Environment
The Database System Environment
• A higher-level stored data manager module of the
DBMS controls access to DBMS information stored
on the disk, whether it is part of the database or the
catalog.
• The DDL compiler process schema definitions,
specific in the DDL, and stored descriptions of the
schema (meta-data) in the DBMS catalog.
The Database System Environment

• The run-time database processor handles database


accesses at run time; it receives retrieval or updated
operations and carries them out on the database.

• The query compiler handles high-level queries that are


entered interactively. (parses and analyzes a query)
The Database System Environment

 The pre-compiler extracts DML commands from an


application program written in a host programming language.
These commands are sent to the DML compiler for
compilation into object code for database access.
Description of the DBMS components
 The top half of the figure show how different users uses the database
environment and interfaces.
 The lower half of the figure show the internals of the DBMS responsible
for storing the data and processing the transactions.
 The database and DBMS catalogue are usually stored on disk. The
allocation of disk input/output devices is done by the Operating System
(OS).
 Catalogue include information such as names, size of file and data types
of data items etc.
 A high level stored data manager module of the DBMS access to the
DBMS information that is stored on the disk.
Database Language and Interfaces
 The top half of the figure show how DBA staff and Casual users uses the
interface to formulate the queries.
 Application programmer who program using some host languages.
Parametric users who do data entry by supplying parameter to predefined
transaction.
 Once the DDL statement is generated, it is sent to DDL compiler.
 DDL compiler process schema definition specified in DDL and further
stores in DBMS catalogue.
 Casual user and person with occasional need for information
from the database uses “Interactive Query”, interface.
 These queries parsed and analysed for the correctness of the
operations for the model, the names of the data element. These
process is done by “Query Compiler”.
 Rearrangement, reordering of operations, elimination of
redundancy is done by the “Query Optimizer”.
 It further consult the system catalogue for the information of
stored data and generate executable code
 Application Programmer write the program into different languages and than
submitted into the pre-compiler.
 The pre-compiler extracts DML commands.
 These commands are sent to DML compiler for compilation into object code
for database access.
 The rest of the program is sent to host language compiler.
 DML commands and rest of the program are linked forming a command
transaction whose executable code includes calls to the runtime database
processor.
 Parametric users also use these canned transaction by supplying parameters
to these transaction so they can run repeatedly as a separate transaction.
Database Utilities

• To perform certain functions such as:


• Loading data stored in files into a database. Includes data conversion
tools.
• Backing up the database periodically on tape.
• Reorganizing database file structures.
• Report generation utilities.
• Performance monitoring utilities.
• Other functions, such as sorting, user monitoring, data compression,
etc.
Other tool

• Data dictionary / repository:


• Used to store schema descriptions and other information such as design
decisions, application program descriptions, user information, usage
standards, etc.
• Active data dictionary is accessed by DBMS software and users/DBA.
• Passive data dictionary is accessed by users/DBA only.
Application Environment

 Application Development Environments and CASE (computer-


aided software engineering) tools:
 Examples – Power builder (Sybase), JBuilder (Borland)
 These systems provide an environment for developing database
applications and include facilities that help in many facets(aspects)
of database systems, including database design, CUI development,
querying and updating, and application program development.

You might also like