Sunteți pe pagina 1din 87

Database

A Database is collection of related data. By data, we mean


known facts that can be recorded and that have implicit
meaning. For example, consider the names, telephone
numbers, and address of the people you know. You may
stored this data on hard drive, using a personal computer and
software such as MS Access, or Excel. This is a collection of
related data with an implicit meaning and it is a database . A
database has the following properties:
 A database represents some aspect of the real world.
Changes in the real world are reflected in the database.
 A database is logically coherent collection of data with
some inherent meaning.
 A database is designed, built, and populated with data for a
specific purpose.
Database Management System
A DBMS is a collection of programs that enables users to
create and maintain a database. The DBMS is hence a general
purpose software system that facilitates the processes of
defining, constructing, manipulating and sharing databases
among various users and applications . Defining a database
involves specifying the data types, structures, and constraints
for the data to be stored in the database. Constructing the
database is the process of storing the data itself on some
storage medium that is controlled by the DBMS.
Manipulating a database includes such functions as querying
the database to retrieve some specific data, updating the
database to reflect changes in the real world, and generating
reports from the data. Sharing a database allows multiple
users and programs to access the database concurrently.
Characteristics of DBMS
 Self-describing nature of a database system
 Insulation between programs and data, and data
abstraction
 Support of multiple views of the data
 Sharing of data and multiuser transaction processing.
 Self-describing nature of a database system- A
fundamental characteristic of the database approach is
that the database system contains not only the
database itself but also a complete definition or
description of the database structure and constraints.
This definition is stored in the DBMs Catalog, which
contains information such as the structure of the each
file , the type and storage format of each data item,
and various constraints on the data. The information
stored in the catalog is called meta-data.
 Insulation between programs and data, and data
abstraction-In traditional file processing, the
structure of data files is embedded in the application
programs, so any changes to the structure of a file may
require changing all programs that access this file. By
contrast , DBMS access programs do not require such
changes in most cases. The structure of data files is
stored in the DBMS catalog separately from the access
program . This property is known as data
independence.
 Support of multiple views of the data-A database
has many users, each of whom may require different
perspective or view of the database. A view may be a
subset of the database or it may contain virtual data
that may be derived from the database files but it is
not explicitly stored.
 Sharing of data and multiuser transaction
processing- A multiuser DBMS, as its name implies,
must allow multiple users to access the database at the
same time. This is essential if data for multiple
applications is to be integrated and maintained in a
single database. The DBMS must include concurrency
control software to ensure that several users trying to
update the same data do so in a controlled manner so
that the result of the updates is correct.
Data Abstraction
Database systems are made-up of complex data
structures. To ease the user interaction with database,
the developers hide internal irrelevant details from
users. This process of hiding irrelevant details from user
is called data abstraction.
Data Independence
A database system normally contains a lot of data in
addition to users’ data. For example, it stores data about
data, known as metadata, to locate and retrieve data
easily. It is rather difficult to modify or update a set of
metadata once it is stored in the database. But as a
DBMS expands, it needs to change over time to satisfy
the requirements of the users. If the entire data is
dependent, it would become a tedious and highly
complex job.
Data Redundancy
Data Redundancy means data duplicity . In traditional
file processing every user group maintains its own files
for handling its data-processing applications. For
example, consider the University database. The
accounting office keeps data on registration and related
billing information, whereas the registration office keeps
track of student courses and grades. Much of the data is
stored twice. Additional user groups may also duplicate
some or all of the same data in their own files. This also
leads to Data inconsistency. In DBMS there is No data
redundancy and thus no data inconsistency.
Advantages of DBMS
 Controlling Redundancy- In database approach, the
views of different user groups are integrated during
database design. This ensures data consistency and it
stores storage space.
 Restricted Unauthorized access- When multiple
users share a large database, it is likely that most users
will not be authorized to access all information in the
database. User or user groups are given account
numbers protected by passwords, which they can use
to gain access to the database. DBMS provides security
and authorization subsystem, which the DBA uses to
create accounts and to specify account restrictions
 Providing storage structures for Efficient query
Processing-Database systems provide capabilities for
efficiently executing queries and updates. To speed up disk
search for the desired records there are files called indexes
are used for this purpose. There is also query processing
and optimization in the DBMS which is responsible for
choosing an efficient query execution plan.
 Providing backup and Recovery- DBMS provides
facilities for recovering from hardware and software
failures. The backup and recovery subsystem of the DBMS
is responsible for recovery.
 Providing multiple user interfaces- Many types of users
with varying levels of technical knowledge use a database,
DBMS include query language for casual users,
programming languages interfaces for application
programmers, menu driven and natural language interfaces
for stand alone users.
 Representation of complex relationships among
data- DBMS has the capability of representing
varieties of data that are interrelated in many ways. It
also has the mechanism to retrieve and update related
data easily and efficiently.
File Management System
A file management system is a type of software that
manages data files in a computer system. It has limited
capabilities and is designed to manage individual or
group files, such as special office documents and
records. It may display report details, like owner,
creation date, state of completion and similar features
useful in an office environment.
A file management system is also known as a file
manager.
File Management System is an application to track the
movement of any file right from its creation. All the
physical movement of the file from one officer to
another will be captured through this system. It keeps a
track of Receipts/Letters also. Using this system user can
keep a track of file & can take certain actions on that file
e.g. Close File, Open File, etc.
Difference between DBMS and
FMS
Difference between File processing system and DBMS:
1. A database management system coordinates both the
physical and the logical access to the data, whereas a
file-processing system coordinates only the physical
access.
2. A database management system reduces the amount
of data duplication by ensuring that a physical piece of
data is available to all programs authorized to have
access to it, whereas data written by one program in a
file-processing system may not be readable by another
program.
3. A database management system is designed to allow
flexible access to data (i.e., queries), whereas a file-
processing system is designed to allow predetermined
access to data (i.e., compiled programs).

4. A database management system is designed to


coordinate multiple users accessing the same data at the
same time. A file-processing system is usually designed
to allow one or more programs to access different data
files at the same time. In a file-processing system, a file
can be accessed by two programs concurrently only if
both programs have read-only access to the file.
5. Redundancy is control in DBMS, but not in file system

6. Unauthorized access is restricted in DBMS but not in


file system.

7. DBMS provide back up and recovery. When data is lost


in file system then it not recover.

8. DBMS provide multiple user interfaces. Data is isolated


in file system,
Database Schema (intension)
• description of the database
• is specified during database design
Database State (extension of the schema)
• current state of the database
• actual data instances (occurrences) in a DB
• changes over time by update
• initially, a database is empty state with no data
• then, populate (load) the database with data
Valid State
• DBMS checks every state of the database
• does it satisfy the structure and constraints
specified in the schema?

Schema Diagram
• for displaying database schema
• schema construct: an object in the schema
• no instance of records
Meta-data
• descriptions of the schema constructs and
constraints
• stored in the database catalog

Schema Evolution
• Schema change prompted by the change of
application requirements
Schemas, Instances and Database
State
Database Schema (meta-data): The description of a
database. Includes descriptions of the database
structure and the constraints that should hold on the
database.
Schema Diagram: A diagrammatic display of (some
aspects of ) a database schema.
Database Instance: The actual data stored in a
database at a particular moment in time. Also called
database state ( or occurrence, snapshot)
The database schema changes very infrequently. The
database state changes every time the database is
updated. Schema is also called intension, whereas
state is called extension.
Figure 2.1 Schema diagram for UNIVERSITY database

schema construct

Known data:
name of record types, data items
Figure 1.2
UNIVERSITY Database
External External External
schema 1 schema 1 schema 1

Conceptual schema

Physical schema

Disk
EEXTERNAL SCHEMA

Three Level Architecture of DBMS


View 1
Item_Name
View 2
continue…
Item_Name
Price Stock

External
Level CONCEPTUAL SCHEMA

Conceptual
Item_Number Character (6)
Item_Name Character(30)
Conceptual Price Numeric(5,2)
Stock Numeric(4)
Level

PHYSICAL SCHEMA

Physical
Stored_Item Length=50
Physical Item # Type = Byte(6), offset = 0, Index = Ix
Level Name Type = Byte(30), offset = 6
Price Type = Byte(8), offset = 36
Stock Type = Byte(4), offset = 44

29
Describes several views of the database based on the
database model.

Several external schemas are possible for a single


database.

Each view is based upon the user requirements.


Data access to be customized at a level of individual
users or groups of users

Each conceptual schema consist of collection of one or


more views.
Describes the stored data in terms of the data model of the DBMS. This leads to
conceptual database design.
There is only one Conceptual schema of Database.
DBMS maps from conceptual schema to physical schema
Example:
Student(RegNo:Integer, Name:String,
Sem:Integer, Branch:String)

Faculty(Fid:Integer, FName:String, Salary:Float)

Course(CourseNo:Integer, CName:String,
Credit:Integere, Dept:String)

Section(SecId:Integer, CourseNo:Integer,
Sem:Integer, Year:Integer, Instructor:String)

GradeReport(RegNo:Integer, SecId:Integer,
Grade:Char)
Describes the actual storage details of the relations
described in conceptual schema.

This leads to the physical database design.

Physical schema specifies additional storage devices

Describes how the relations described in conceptual schema


are stored on secondary storage devices such as disks and
tapes.
The data independence is the ability to change the
schema at one level of a database system with out
changing the schema at a higher level.

Logical data Independence


capacity to change the conceptual schema
without having to change the external schema, is
called as the logical data independence. With out
changing the application programs, one can change
the logical schema.
Example
Suppose the Faculty relation is modified as:
Fa(Fid: Integer, FName:String, Office:Integer)

Faculty_Private(Fid:Integer, Salary:Float)

Any view designed before this modification can


still retrieve the data with little modification (relation
name) and obtain the same answer.
Physical data independence
Capacity to change the internal schema without having
to change the conceptual schema is known as Physical
data Independence.

There are occasions for changing the internal structures


for improved performance of the retrieval of data.

Any change introduced to the internal schema or


physical schema will not affect the other schemas.
Data Model
Data modeling is often the first step in database design
and object-oriented programming as the designers first
create a conceptual model of how data items relate to
each other. Data modeling involves a progression from
conceptual model to logical model to physical schema.
A Database model defines the logical design of data. The
model describes the relationships between different
parts of the data. In history of database design, three
models have been in use.

 Hierarchical Model
 Network Model
 Relational Model
Hierarchical data model
A hierarchical database model is a data model in
which the data is organized into a tree-like structure.
The data is stored as records which are connected to
one another through links. A record is a collection of
fields, with each field containing only one value.
The entity type of a record defines which fields the
record contains.
A record in the hierarchical database model
corresponds to a row (or tuple) in the relational data
model and an entity type corresponds to a table (or
relation).
 The hierarchical database model mandates that each
child record has only one parent, whereas each parent
record can have one or more child records. In order to
retrieve data from a hierarchical database the whole
tree needs to be traversed starting from the root node.
This model is recognized as the first database model
created by IBM in the 1960s
Network Data Model
The network model is a database model conceived as a
flexible way of representing objects and their
relationships. Its distinguishing feature is that the
schema, viewed as a graph in which object types are
nodes and relationship types are arcs, is not restricted to
being a hierarchy or lattice.
While the hierarchical database model structures data as
a tree of records, with each record having one parent
record and many children, the network model allows
each record to have multiple parent and child records,
forming a generalized graph structure. The network
model, in comparison to the hierarchic model, was that
it allowed a more natural modeling of relationships
between entities. Although the model was widely
implemented and used, it failed to become dominant for
two main reasons. Firstly, IBM chose to stick to the
hierarchical model with semi-network extensions in
their established products. Secondly, it was eventually
displaced by the relational model ,which offered a
higher-level, more declarative interface.
Relational Model
The relational model (RM) for database management
is an approach to managing data using a structure and
language consistent with first-order predicate logic, first
described in 1969 by Edgar F. Codd. In the relational
model of a database, all data is represented in terms
of tuples, grouped into relations. A database organized
in terms of the relational model is a relational database.
The purpose of the relational model is to provide
a declarative method for specifying data and queries:
users directly state what information the database
contains and what information they want from it, and let
the database management system software take care of
describing data structures for storing the data and
retrieval procedures for answering queries.

Most relational databases use the SQL data definition


and query.
ER Model
An entity–relationship model (ER model) is a data
model for describing the data or information aspects of a
business domain or its process requirements, in an
abstract way that lends itself to ultimately being
implemented in a database such as a relational database.
The main components of ER models are entities(things)
and the relationships that can exist among them.

Entity–relationship modeling was developed by Peter


Chen
An entity–relationship model is the result of using a
systematic process to describe and define a subject area
of business data. It does not define business process;
only visualize business data. The data is represented as
components (entities) that are linked with each other
by relationships that express the dependencies and
requirements between them.

Entities may have various properties (attributes) that


characterize them. Diagrams created to represent these
entities, attributes, and relationships graphically are
called entity–relationship diagrams
Object oriented Data Model
An object database (also object-oriented database
management system) is a database management
system in which information is represented in the form
of objects as used in object-oriented programming.
Object databases are different from relational
databases which are table-oriented. Object-relational
databases are a hybrid of both approaches.

Object databases have been considered since the early


1980s
Object-oriented database management systems
(OODBMSs) combine database capabilities with object-
oriented programming language capabilities. OODBMSs
allow object-oriented programmers to develop the
product, store them as objects, and replicate or modify
existing objects to make new objects within the
OODBMS. Because the database is integrated with the
programming language, the programmer can maintain
consistency within one environment, in that both the
OODBMS and the programming language will use the
same model of representation. Relational DBMS
projects, by way of contrast, maintain a clearer division
between the database model and the application.
ER MODEL
Entity, Attributes, and Keys
Entity
 A generalized class of people, places, or things (objects) for
which data are collected, stored, and maintained are known as
Entity. It may be physical or logical.
 E.g., Customer, Employee, Department

Attribute
 A characteristic of an entity; something the entity is identified by
 E.g., Customer name, Employee name

 Domain
 An attribute of an entity can have a value from a value set .This
Value set is called Domain.
Entity Type and Entity Set

Entity Type
It defines a set of entities that have the same properties or same
attributes. Each Entity type in the database is described by its name
and attributes. For example Company, Employee.

Entity Set

A collection of similar entities. It is a set of entities of that share the


same properties or same attributes.
Example: set of all persons, companies, trees, holidays.

All entities in an entity set have the same attributes.


For example a company employing hundreds of employees may want
to store similar information concerning each of the employee.
Employee(Entity Type)
Entity SET

{
EmpId EmpName Address PhNo
E001 Rahul Delhi 1234567890
E002 Neel Mumbai 9876543211
E003 Hardik Bangalore 9765437623
E004 Priyanka Calcutta 9854321355
Types of Attribute
 Simple Versus Composite
 Single valued versus Multi valued
 Stored and Derived

Simple Versus Composite

Attributes which can not be divided in to subparts are known as


Simple attributes. e.g . Gender, Nationality.

Attributes which can be divided in to subparts are known as


Composite attributes. e.g Address can be subdivided in to Street
address, City, State and Zip
Single valued versus Multi valued
Most attributes have a single value for a particular entity, such
attributes are known as Single valued. e.g Age is a single valued
attribute of person.
In some cases an attribute can have a set of values for the same
entity.Such attributes are known as Multi Value. For example color of a
car or a college degrees attribute for a person.

Stored and Derived


In Some cases two attribute values are related. For example the Age and
Birthdate attributes of a person. For a particular person entity, the
value of age can be determined from the current date and the value of
that person’s Birth date.The age attribute is hence called a Derived
attribute and said to be derivable from the Birthdate attribute, which
is called a Stored attribute.
Relationship
Association among two or more entities.
 Represented by a diamond.
 relationships can have their own attributes.
A relationship must be uniquely identified by the
participating entities, without reference to its own
attributes.
Relationship Set
Collection of similar relationships.
An n-ary relationship set R relates n entity sets E1 ... En ; each
relationship in R involves entities e1  E1, ..., en  En.
For example consider a relationship type Works_for between
the two entity types Employee and Department, which
associates each employee with the department the employee
works for.

Degree of Relation
The degree of a relationship type is the number of participating entity
types.
Hence the Works_for relationship is of degree two.Because the
works_for Relation is between EMPLOYEE and DEPARTMENT.
Types of Relationship Depending Upon the Degree

 Binary Relationship
The relationship having degree two is known as Binary relationship. e.g
The relationship between STUDENT and FACULTY
 Ternary Relationship
The relationship type of degree three is called ternary relationship.For
example relationship Supply between the SUPPLIER,PART and
PROJECT
Relationship Cardinality
The cardinality ratio for a binary relationship specifies the number of
relationship instances that an entity can participate in. For example, in
the works-for binary relationship type, Department: Employee is of
cardinality ratio 1:N,meaning that each Department can be related to
numerous employees.
Keys

A key is an attribute (also known as column or field) or a


combination of attribute that is used to identify records in a
table OR a key is a minimal set of attributes whose values
uniquely identify an entity in some entity set.

 For each entity set, we choose a key.


 Sometimes we might have to retrieve data from more than one table, in
those cases we require to join tables with the help of keys.

For examples let suppose we have an Employee Table


with attributes ID, Name , Address , Department_ID
,Salary)
Types Of Keys
Super Key – An attribute or a combination of attribute that is used
to identify the records uniquely is known as Super Key. A table
can have many Super Keys.
E.g. of Super Key
1 ID
2 ID, Name
3 ID, Address
4 ID, Department_ID
5 ID, Salary
6 Name, Address
7 Name, Address, Department_ID ………… So on as any
combination which can identify the records uniquely will be a
Super Key .
Candidate Key – It can be defined as minimal Super Key or
irreducible Super Key. In other words an attribute or a
combination of attribute that identifies the record uniquely but
none of its proper subsets can identify the records uniquely.

E.g. of Candidate Key


1 Code
2 Name, Address
For above table we have only two Candidate Keys (i.e. Irreducible
Super Key) used to identify the records from the table uniquely.
Code Key can identify the record uniquely and similarly
combination of Name and Address can identify the record
uniquely, but neither Name nor Address can be used to identify
the records uniquely as it might be possible that we have two
employees with similar name or two employees from the same
house.
Primary Key – A Candidate Key that is used by the database
designer for unique identification of each row in a table is known
as Primary Key. A Primary Key can consist of one or more
attributes of a table.
E.g. of Primary Key - Database designer can use one of the
Candidate Key as a Primary Key. In this case we have “Code” and
“Name, Address” as Candidate Key, we will consider “Code” Key
as a Primary Key as the other key is the combination of more
than one attribute.
Foreign Key – A foreign key is an attribute or combination of attribute in
one base table that points to the candidate key (generally it is the
primary key) of another table. The purpose of the foreign key is to
ensure referential integrity of the data i.e. only values that are supposed
to appear in the database are permitted.

E.g. of Foreign Key – Let consider we have another table i.e.


Department Table with Attributes “Department_ID”,
“Department_Name”, “Manager_ID”, ”Location_ID” with
Department_ID as an Primary Key. Now the Department_ID attribute
of Employee Table (dependent or child table) can be defined as the
Foreign Key as it can reference to the Department_ID attribute of the
Departments table (the referenced or parent table), a Foreign Key value
must match an existing value in the parent table or be NULL.
Composite Key – If we use multiple attributes to create a Primary Key
then that Primary Key is called Composite Key (also called a
Compound Key or Concatenated Key).
E.g. of Composite Key, if we have used “Name, Address” as a Primary
Key then it will be our Composite Key.

Alternate Key – Alternate Key can be any of the Candidate Keys except
for the Primary Key.
E.g. of Alternate Key is “Name, Address” as it is the only other
Candidate Key which is not a Primary Key.
Secondary Key – The attributes that are not even the Super Key but can
be still used for identification of records (not unique) are known as
Secondary Key.

E.g. of Secondary Key can be Name, Address, Salary, Department_ID


etc. as they can identify the records but they might not be unique.
Entity vs. Attribute
 “Address”:
 attribute of Employees?
 Entity of its own?
 It depends! Semantics and usage.
 Several addresses per employee?
 must be an entity
 atomic attribute types (no set-valued attributes!)
 Care about structure? (city, street, etc.)
 must be an entity!
 atomic attribute types (no tuple-valued attributes!)
Entity vs. Relationship
 Separate discretionary budget (dbudget) for each dept.
 What if manager’s dbudget is a SUM that covers all managed depts
 Could repeat value
 Better design:
Associate dbudget with the appointment of the employee as manager
of a group of depts.
The information can be obtained from the Database by
asking some direct questions known as
Queries. Such questions involves the data stored in the
DBMS. e.g. What are the Name of all students stored in
Database Student?

DBMS provides a specialized language, called the


Query Language in which queries can be posed.
DDL – Data Definition Language
SDL – Storage Definition Language
VDL – View Definition Language
DML – Data Manipulation Language
(For data manipulations like
insertion, deletion, update,
retrieval, etc.)
DCL - Data Control language.
Database Languages and Interfaces
provide appropriate languages and interfaces for each category of users.

DBMS Languages
Data Definition Language (DDL) Used by the DBA and database designers to
specify the conceptual schema of a database. In many DBMSs, the DDL is also
used to define internal and external schemas (views). In some DBMSs, separate
storage definition language (SDL) and view definition language (VDL) are
used to define internal and external schemas.In General storage definition
language (SDL) and view definition language (VDL) are the part of DDL.

Data Manipulation Language (DML) Used to specify database retrievals and


updates (insertion, deletion, modifications)

- DML commands (data sublanguage) can be embedded in a general-purpose


programming language (host language).
- Alternatively, stand-alone DML commands can be applied directly (query
language).
Find all courses that “Mary” takes

SELECT C.name
FROM Students S, Takes T, Courses C
WHERE S.name=“Mary” and
S.ssn = T.ssn and T.cid = C.cid

What happens behind the scene ?


Query processor figures out how to answer the
query efficiently.
Declarative SQL query Imperative query execution plan:
sname
SELECT C.name
FROM Students S, Takes T, Courses C
WHERE S.name=“Mary” and
S.ssn = T.ssn and T.cid = C.cid cid=cid

sid=sid

name=“Mary”

Students Takes Courses

The optimizer chooses the best execution plan for a query


SQL is a computer language for defining data
structures.
The term was first introduced in relation to the Codasyl
database model, where the schema of the database
was written in a Data Definition Language describing
the records, fields, and "sets" making up the user Data
Model.
Initially it referred to a subset of SQL, but is now used
in a generic sense to refer to any formal language for
describing data or information structures, like XML
schemas.
CREATE statements
Create - To make a new database, table, index, or
stored query. A CREATE statement in SQL creates an object
inside of a relational database management
system(RDBMS).

CREATE TABLE
CREATE [TEMPORARY] TABLE [table name] (
[column definitions] ) [table parameters].

Column Definitions: A comma-separated list consisting of


any of the following
Column definition: [column name] [data type] {NULL
| NOT NULL} {column options}
 Primary key definition: PRIMARY KEY ( [comma
separated column list] )

 CONSTRAINTS: {CONSTRAINT} [constraint


definition]

 For example, the command to create a table named


employees with a few sample columns would be:

CREATE TABLE employees ( id INTEGER PRIMARY


KEY, first_name CHAR(50) NOT NULL, last_name
CHAR(75) NULL, dateofbirth DATE NOT NULL );
DROP statements
Drop - To destroy an existing database, table, index,
or view.

A DROP statement in SQL removes an object from a


relational database management system (RDBMS).

The typical usage is simply DROP objecttype objectname.


For example, the command to drop a table named
employees would be: DROP TABLE employees;

.
The DROP statement is distinct from the DELETE and
(non-standard) TRUNCATE statements, in that they do
not remove the table itself. For example, a DELETE
statement might delete some (or all) data from a table
while leaving the table itself in the database, whereas a
DROP statement would remove the entire table from the
database
ALTER statements
Alter - To modify an existing database object.

An ALTER statement in SQL changes the properties of an


object inside of a relational database management system
(RDBMS).

The typical usage is ALTER objecttype objectname


parameters.
For example, the command to add (then remove) a
column named bubbles for an existing table named sink
would be:

ALTER TABLE sink ADD bubbles INTEGER;


ALTER TABLE sink DROP COLUMN bubbles;
Data Manipulation Language (DML) is a family of
computer languages used by computer programs and/or
database users to insert, delete and update data in a
database. Read-only querying, i.e. SELECT, of this data may
be considered to be either part of DML or outside it,
depending on the context.

SELECT ... INTO


INSERT
UPDATE
DELETE
Types of DML

-Procedural DML:
• Also called record-at-a-time (record-oriented) or low-level DML
• Must be embedded in a programming language.
• Searches for and retrieves individual database records and uses looping
and other constructs of the host programming language to retrieve multiple
records.

-Declarative or non-procedural DML:


• Also called set-at-a-time (set-oriented) or high-level DML.
• Can be used as a stand-alone query language or can be embedded in a
programming language.
• Searches for and retrieves information from multiple related database
records in a single command.

- host language: general-purpose language


- data sublanguage: DML
High-level DML: set-oriented, declarative
Low-level DML: record-oriented, procedural
Types of DML
data sublangauge: DML embedded in a general purpose
language (for DBAs)
query language: high-level, interactive, stand-alone
DML (casual end users)
user-friendly interface for DML (naïve users)
DCL Commands are used to control the access to
the Database.
GRANT - gives user's access privileges to database
REVOKE - withdraw access privileges given with the
GRANT command
Database Users
 Database administrators:
Responsible for authorizing access to the database,
for coordinating and monitoring its use, acquiring
software and hardware resources, controlling its use
and monitoring efficiency of operations.
 Database Designers:
Responsible to define the content, the structure, the
constraints, and functions or transactions against
the database. They must communicate with the
end-users and understand their needs.
 End Users
 Casual: access database occasionally by
sophisticated query language when needed.
(Manager)
 Naïve: or Parametric: they make up a large section
of the end-user population. Learn only a few
facilities that they may use repeatedly
(bank clerk)
 Sophisticated: These include business analysts,
scientists, engineers, others thoroughly familiar
with the system capabilities.
 Stand-alone: Normal users

S-ar putea să vă placă și