0% found this document useful (0 votes)
49 views

Module 01

Uploaded by

Shreyas B R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Module 01

Uploaded by

Shreyas B R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Module-1

1. With a neat diagram, explain three schema architectures

THREE SCHEMA ARCHITECTURE


1. Internal Level
• The internal level has an internal schema which describes the physical storage structure of
the database.
• The internal schema is also known as a physical schema.
• It uses the physical data model. It is used to define that how the data will be stored in a
block.
• The physical level is used to describe complex low-level data structures in detail.
2. Conceptual Level
• The conceptual schema describes the design of a database at the conceptual level.
Conceptual level is also known as logical level.
• The conceptual schema describes the structure of the whole database.
• The conceptual level describes what data are to be stored in the database and also describes
what relationship exists among those data.
• In the conceptual level, internal details such as an implementation of the data structure are
hidden.
• Programmers and database administrators work at this level.
3. External Level
• At the external level, a database contains several schemas that sometimes called as
subschema. The subschema is used to describe the different view of the database.
• An external schema is also known as view schema.
• Each view schema describes the database part that a particular user group is interested and
hides the remaining database from that user group.
• The view schema describes the end user interaction with database systems
Mapping between Views
There are basically two types of mapping in the database architecture:
o Conceptual/ Internal Mapping
o External / Conceptual Mapping
Conceptual/ Internal Mapping
• The Conceptual/ Internal Mapping lies between the conceptual level and the internal level.
• Its role is to define the correspondence between the records and fields of the conceptual
level and files and data structures of the internal level.
External/ Conceptual Mapping
• The external/Conceptual Mapping lies between the external level and the Conceptual level.
• Its role is to define the correspondence between a particular external and the conceptual
view.

2. List and explain the characteristics, advantages of the DBMS approach.


Ans: -CHARACTERISTICS OF THE DATABASE APPROACH
1. 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 system catalog.
• The information stored in the catalog is called meta-data, and it describes the structure of the
primary database.

2. Insulation between Programs and Data, and Data Abstraction


• the structure of data files is embedded in the access 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
programs. We call this property program-data independence.
• The characteristic that allows program-data independence and program-operation
independence is called data abstraction.
• A data model is a type of data abstraction that is used to provide this conceptual
representation
3. Support of Multiple Views of the Data
• A database typically has many users, each of whom may require a different perspective
or view of the database.
• A view may be a subset of the database or it may contain virtual data that is derived from the
database files but is not explicitly stored.
• Some users may not need to be aware of whether the data they refer to is stored or derived.
4. 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.
• These types of applications are generally called on-line transaction processing (OLTP)
applications.
• A fundamental role of multiuser DBMS software is to ensure that concurrent transactions
operate correctly.
Major Advantages Of DBMS
❖ Controlling Redundancy
❖ Restricting Unauthorized Access
❖ Providing Persistent Storage for Program Objects and Data Structures
❖ Permitting Inferencing and Actions Using Rules
❖ Providing Multiple User Interfaces
❖ Representing Complex Relationships Among Data
❖ Enforcing Integrity Constraints
❖ Additional Implications of the Database Approach
1. Controlling Redundancy
• In traditional software development utilizing file processing, every user group
maintains its own files for handling its data-processing applications.
• the data is stored twice: once in the files of each user group. Additional user groups may
further duplicate some or all of the same data in their own files.
• This redundancy in storing the same data multiple times leads to several problems
• First, there is the need to perform a single logical update—such as entering data on a new
student—multiple times: once for each file where student data is recorded
• This leads to duplication of effort. Second, storage space is wasted when the same data is
stored repeatedly, and this problem may be serious for large databases. Third, files that
represent the same data may become inconsistent.
2. Restricting Unauthorized Access
• When multiple users share a database, it is likely that some users will not be authorized to
access all information in the database.
• the type of access operation—retrieval or update—must also be controlled.
• Typically, users or user groups are given account numbers protected by passwords, which they
can use to gain access to the database.
3. Providing Persistent Storage for Program Objects and Data Structures
• Databases can be used to provide persistent storage for program objects and data
structures.
• This is one of the main reasons for the emergence of the object-oriented database
systems.
• The persistent storage of program objects and data structures is an important function of
database systems.
• Traditional database systems often suffered from the so-called impedance mismatch problem,
since the data structures provided by the DBMS were incompatible with the programming
language’s data structures.
• database systems typically offer data structure compatibility with one or more object oriented
programming languages.
4. Permitting Inferencing and Actions Using Rules
• Some database systems provide capabilities for defining deduction rules for inferencing new
information from the stored database facts.
• Such systems are called deductive database systems.
• These can be specified declaratively as rules, which when compiled and maintained by the
DBMS can determine all students on probation.
5. Providing Multiple User Interfaces
• Because many types of users with varying levels of technical knowledge use a database, a
DBMS should provide a variety of user interfaces.
• These include query languages for casual users; programming language interfaces for
application programmers; forms and command codes for parametric users; and menu driven
interfaces and natural language interfaces for stand-alone users.
• Both forms-style interfaces and menu-driven interfaces are commonly known as
graphical user interfaces (GUIs).
6. Representing Complex Relationships Among Data
• A database may include numerous varieties of data that are interrelated in many ways.
• A DBMS must have the capability to represent a variety of complex relationships among the
data as well as to retrieve and update related data easily and efficiently.
7. Enforcing Integrity Constraints
• Most database applications have certain integrity constraints that must hold for the data.
• A DBMS should provide capabilities for defining and enforcing these constraints.
• The simplest type of integrity constraint involves specifying a data type for each data item.
8. Providing Backup and Recovery
• A DBMS must provide facilities for recovering from hardware or software failures. The backup
and recovery subsystem of the DBMS is responsible for recovery.
• For example, if the computer system fails in the middle of a complex update program, the
recovery subsystem is responsible for making sure that the database is restored to the state it
was in before the program started executing.
Additional Implications of the Database Approach
➢ Potential for Enforcing Standards
➢ Reduced Application Development Time
➢ Flexibility
➢ Availability of Up-to-Date Information
➢ Economies of Scale
Potential for Enforcing Standards
• The Database approach permits the DBA to define and enforce standards among database
users in a large organization.
• Standards can be defined for names and formats of data elements, display formats, report
structures, terminology, and so on.
Reduced Application Development Time
• A prime selling feature of the database approach is that developing a new application—
such as the retrieval of certain data from the database for printing a new report—takes very
little time.
• Designing and implementing a new database from scratch may take more time than writing a
single specialized file application
Flexibility
• It may be necessary to change the structure of a database as requirements change.
• Modern DBMSs allow certain types of changes to the structure of the database without
affecting the stored data and the existing application programs.
Availability of Up-to-Date Information
• A DBMS makes the database available to all users. As soon as one user’s update is
applied to the database, all other users can immediately see this update.
• This availability of upto-date information is essential for many transaction-processing
applications, such as reservation systems or banking databases.
Economies of Scale
• The DBMS approach permits consolidation of data and applications, thus reducing the amount
of wasteful overlap between activities of data-processing personnel in different projects or
departments.

3. Explain different types of user-friendly interfaces and types of users who typically use
each.
Ans: -DBMS Interfaces
➢ Menu-Based Interfaces for Browsing
➢ Forms-Based Interfaces
➢ Graphical User Interfaces
➢ Natural Language Interfaces
➢ Interfaces for Parametric Users
➢ Interfaces for the DBA
1. Menu-Based Interfaces for Browsing
• These interfaces present the user with lists of options, called menus, that
lead the user through the formulation of a request.
• Menus do away with the need to memorize the specific commands and
syntax of a query language; rather, the query is composed step by step by
picking options from a menu that is displayed by the system.
• They are often used in browsing interfaces, which allow a user to look
through the contents of a database in an exploratory and unstructured
manner.
2. Forms-Based Interfaces
• A forms-based interface displays a form to each user. Users can fill out all
of the form entries to insert new data, or they fill out only certain entries, in
which case the DBMS will retrieve matching data for the remaining entries.
• Forms are usually designed and programmed for naive users as interfaces to
canned transactions.
3. Graphical User Interfaces
• A graphical interface (GUI) typically displays a schema to the user in
diagrammatic form. The user can then specify a query by manipulating the
diagram.
• In many cases, GUIs utilize both menus and forms. Most GUIs use a
pointing device, such as a mouse, to pick certain parts of the displayed
schema diagram.
4. Natural Language Processing
• These interfaces accept requests written in English or some other language
and attempt to "understand" them.
• A natural language interface usually has its own "schema," which is similar
to the database conceptual schema.
• The natural language interface refers to the words in its schema, as well as
to a set of standard words, to interpret the request.
5. Interfaces For Parametric users
• Parametric users, such as bank tellers, often have a small set of operations
that they must perform repeatedly.
• Systems analysts and programmers design and implement a special interface
for a known class of naive users.
• Usually, a small set of abbreviated commands is included, with the goal of
minimizing the number of keystrokes required for each request.
6. Interfaces For the DBA
• Most database systems contain privileged commands that can be used only
by the DBA’s staff.
• These include commands for creating accounts, setting system parameters,
granting account authorization, changing a schema, and reorganizing the
storage structures of a database.

4. Explain component modules of DBMS and their interaction.

• The database and the DBMS catalog are usually stored on disk.
• Access to the disk is controlled primarily by the operating system (OS), which schedules
disk input/output.
• A higher-level stored data manager module of the DBMS controls access to
DBMS information that is stored on disk, whether it is part of the database or the
catalog.
• The stored data manager may use basic OS services for carrying out low level
data transfer between the disk and computer main storage, but it controls other
aspects of data transfer, such as handling buffers in main memory.
• The DDL compiler processes schema definitions, specified in the DDL, and
stores descriptions of the schemas (meta-data) in the DBMS catalog.
• The catalog includes information such as the names of files, data items, storage
details of each file and so on.
• The run-time database processor handles database accesses at run time; it
receives retrieval or update query compiler handles high-level queries that are
entered interactively.
• It parses, analyzes, and compiles or interprets a query by creating database
access code, and then generates calls to the run-time processor for executing the
code.
• 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

5. Explain the Different categories of data models?


Ans: - Categories of Data Models
❖ High-level or conceptual data models provide concepts that are close to the
way many users perceive data.
❖ low-level or physical data models provide concepts that describe the details of
how data is stored in the computer.
❖ representational (or implementation) data models, which provide concepts
that may be understood by end users but that are not too far removed from the
way data is organized within the computer. Representational data models
represent data by using record structures and hence are sometimes called
record-based data models.
❖ Representational or implementation data models are the models used most
frequently in traditional commercial DBMSs, and they include the widely-used
relational data model.
❖ legacy data models—the network and hierarchical models.
❖ object data models are new family of higher-level implementation data models
that are closer to conceptual data models.

6. Criteria used to classify DBMSs are


1. Data model on which the DBMS is based
• Relational: represents a database as a collection of tables, where each table can be
stored as a separate file.
• Object: defines a database in terms of objects, their properties, and their
operations.
• Objects with the same structure and behaviour belong to a class, and classes are
organized into hierarchies (or acyclic graphs).
• The operations of each class are specified in terms of predefined procedures
called methods.
• Hierarchical and network (legacy): The network model represents data as record
types and also represents a limited type of 1: N relationship, called a set type.
• The hierarchical model represents data as hierarchical tree structures. Each
hierarchy represents a number of related records.
• Native XML DBMS: uses hierarchical tree structures. It combines database
concepts with concepts from document representation models. Data is represented
as elements; with the use of tags, data can be nested to create complex
hierarchical structures.
2. Number of users supported by the system
• Single-user: support only one user at a time and are mostly used with PCs.
• Multiuser: support concurrent multiple users.
3. Number of sites over which the database is distributed
• Centralized: data is stored at a single computer site
• Distributed: can have the actual database and DBMS software distributed over
many sites, connected by a computer network
• Homogeneous DDBMSs use the same DBMS software at all the sites
• Heterogeneous DDBMSs can use different DBMS software at each site
4. Cost
• Open source: products like MySQL and PostgreSQL that are supported by third party vendors
with additional services.
• Different types of licensing: Standalone single user versions of some systems like
Microsoft Access are sold per copy or included in the overall configuration of a
desktop or laptop.
• In addition, data warehousing and mining features, as well as support for
additional data types, are made available at extra cost.
5. On the basis of the types of access path options for storing files
• One well-known family of DBMSs is based on inverted file structures.
6. General purpose or Special purpose
• When performance is a primary consideration, a special-purpose DBMS can be
designed and built for a specific application; such a system cannot be used for
other applications without major changes.
• Many airline reservations and telephone directory systems developed in the past
are special-purpose DBMSs.

7. With a neat block diagram, explain the architecture of a typical DBMS.?


Ans: - DBMS architecture
a) Centralized architecture
• Combines everything into single system including-DBMS software, hardware,
application programs, and user interface processing software.
• User can still connect through a remote terminal –however, all processing is
done at centralized site.
b) Basic 2-tier Client-Server Architectures
Specialized Servers with Specialized functions
Print server
File server
DBMS server
Web server
Email server
Clients can access the specialized servers as Needed

Clients
• Provide appropriate interfaces through a client software module to access and
utilize the various server’s resources.
• Clients may be diskless machines or PCs or Workstations with disks with only
the client software installed.
• Connected to the servers via some form of a network.

DBMS SERVER
• Provides database query and transaction services to the clients.
• Relational DBMS servers are often called SQL servers, query servers,
or transaction servers Applications running on clients utilize an
application program Interface (API) to access server databases via
standard interface such as:
• ODBC: Open Database Connectivity standard
• JDBC: for Java programming access
• Client and server must install appropriate client module and server module
software for ODBC or JDBC
A client program may connect to several DBMSs, sometimes called the data sources.
• In general, data sources can be files or other non-DBMS software that manages
data.
• Other variations of clients are possible: e.g., in some object DBMSs, more
functionality is transferred To clients including data dictionary functions,
optimization and recovery across multiple servers, etc.’
c) Three-tier client /server Architecture
Common for Web applications
1) Intermediate Layer called Application Server or Web Server:
• Stores the web connectivity software and the business logic part of the
application used to access the corresponding data from the database server.
• Acts like a conduit for sending partially processed data between the database
server and the client.

2). Three-tier Architecture Can Enhance Security:


• Database server only accessible via middle tier
• Clients cannot directly access database server

. Explain the Different types of attributes that occur in an ER diagram model with Example?
1. Simple attributes
• Simple attributes are those attributes which cannot be divided further.
Ex:-

• Here, all the attributes are simple attributes as they cannot be divided further.
2. Composite attributes
• Composite attributes are those attributes which are composed of many other simple
attributes.
Ex: -
• Here, the attributes “Name” and “Address” are composite attributes as they are composed
of many other simple attributes.
3. Single valued attributes
• Single valued attributes are those attributes which can take only one value for a given entity
from an entity set.
Ex: -

• Here, all the attributes are single valued attributes as they can take only one specific value
for each entity.
4. Multi valued attributes
• Multi valued attributes are those attributes which can take more than one value for a given
entity from an entity set.
Ex:

• Here, the attributes “Mob_no” and “Email_id” are multi valued attributes as they can take
more than one values for a given entity.
5. Derived attributes
• Derived attributes are those attributes which can be derived from other attribute(s).
Ex: -

• Here, the attribute “Age” is a derived attribute as it can be derived from the attribute
“DOB”.
6. Key attributes
• Key attributes are those attributes which can identify an entity uniquely in an entity set.
Ex: -

Here, the attribute “Roll_no” is a key attribute as it can identify any student uniquely.

E-R Diagrams

You might also like