Database System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

I N T RO D U C T I O N TO

DATA B A S E S Y S T E M C O N C E P T S
A N D A RC H I T E C T U R E

2nd Sem, MSc. (BA)

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


CONTENT
❑ Database System Concepts
• Data Models, Schemas, Instances,
• Schema Architecture and Data Independence,
• Database Languages and Interfaces,
• Database System Environment,
• Users, Administrator, Architecture,

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Basic client/server architecture is used to deal with many PCs, web servers, database servers and other
components that are connected with networks.
• DBMS architecture depends upon how users are connected to the database to get their request done.
• Database architecture can be seen as a single tier or multi-tier.
• Multi-tier database architecture is of two types like: 2-tier architecture and 3-tier architecture.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

1-Tier Architecture

• Database is directly available to user (user can directly use DBMS).


• Any changes done here will directly be done on database itself.
o It doesn't provide a handy tool for end users.
• 1-Tier architecture is used for development of local application, where programmers can directly
communicate with database for quick response.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

2-Tier Architecture
• Basic client-server.
• Applications on client end can directly communicate with database at server side.
• For this interaction, API's like: ODBC, JDBC are used.
• User interfaces and application programs are run on client-side.
• Server side is responsible to provide functionalities like: query processing
and transaction management.
• To communicate with DBMS, client-side application establishes connection
with server side.
• Advantage: maintenance and understanding are easier, compatible with
existing systems.
• Challenge: poor performance when there are a large number of users.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

3-Tier Architecture

• Contains another layer between client and server.


• Client can't directly communicate with server.
• Application on client-end interacts with application server which further
communicates with database system.
• End user has no idea about existence of database beyond application
server.
• Database also has no idea about any other user beyond application.
• 3-Tier architecture is used in case of large web applications.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Advantages:
• Enhanced scalability due to distributed deployment of application servers. Now, individual connections
need not be made between client and server.
• Data Integrity is maintained. Since there is a middle layer between client and server, data corruption can be
avoided/removed.
• Security is improved. This type of model prevents direct interaction of the client with the server thereby
reducing access to unauthorized data.

Disadvantages:
• Increased complexity of implementation and communication. becomes difficult for this sort of interaction to
take place due to the presence of middle layers.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• DBMS is collection of interrelated data and set of programs that allow users to access and modify
these data.
• DBMS provides users with an abstract view of data. (Data Abstraction)
o System hides certain details of how data are stored and maintained; rather showing only
required info.
• Three level/schema architecture: Since many DBMS users are not computer trained, complexity

are hidden through several levels of abstraction, to simplify users’ interactions with system:
o Physical level (Internal View/Schema)
o Logical level (Conceptual View/Schema)
o View level (External View/Schema)

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Physical level: Lowest level of abstraction describes how & where data are actually stored.
o Describes complex low-level data structures in detail.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Logical level: Next-higher level of abstraction describes what data are stored in database, and what
relationships exist among those data.
o Describes the structure of the whole database.
o Describes what data to be stored in database and also what relationship exists among those data.
o Programmers and database administrators work at this level.

o Describes entire database in terms of small number of


relatively simple structures (tables).
o Example, STUDENT database may contain STUDENT and
COURSE tables which will be visible to users.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• View level: Highest level of abstraction describes only part of entire database.
o Though logical level uses simpler structures, complexity remains because of variety of information
stored in large database (all this information not needed by many users; instead, they need to access
only a part of database).
o View level of abstraction exists to simplify their interaction with system.
o System may provide many views/schemas for same database.

o Example, FACULTY of a university is interested in looking course details of students, STUDENTS are interested
in looking at all details related to academics, accounts, courses and hostel details as well.
o Different views can be generated for different users.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Two types of mapping in database architecture:

Conceptual-Internal Mapping
• Between conceptual level and internal level.
• Its role is to define correspondence between records and fields of conceptual level and files/data structures of
internal level.

External-Conceptual Mapping
• Between external level and Conceptual level.
• Its role is to define correspondence between a particular external and conceptual view.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Data Independence

• Change of data at one level should not affect another level.


• Two types of data independence:
• Physical Data Independence: Any change in physical location of tables and indexes should not affect
conceptual level or external view of data.
o Easy to achieve and implemented by most of the DBMS.
• Conceptual Data Independence: Change in conceptual schema should not affect external schema.
o Adding or deleting attributes of a table should not affect user’s view of table.
o Difficult to achieve as compared to physical data independence.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Databases change over time as information is inserted and deleted.


• Instance: Collection of information stored in database at a particular moment.
o Current state of database
o Also called as current state or database state.

• There are three types of states present in database −


o Empty state: When ever a new database is defined.
o Initial state: first time data is loaded in database.
o Current state: the present operation is applied to database.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Schema: Overall design (skeleton structure) of database.


o Represents the logical view of entire database.
o contains schema objects like table, foreign key, primary key, views, columns, data types, stored
procedure, etc.
o schema diagram: can be represented by using the visual diagram
o Schemas/design of database are changed infrequently, if at all.
o Database systems have several schemas, partitioned according to the levels of abstraction.
• Physical schema describes database design at physical level.
• Logical schema describes database design at logical level.
• External schema is the highest level of a schema which defines the views for end users.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Schema: Overall design (skeleton structure) of database.


• gives an overall description of database.
• schema diagram defines how data is organized in database.
• schema diagram contains entities and attributes that will define that schema.
• schema diagram only shows database design; NOT the actual data of database.
• can be a single table or can have more than one table which is related.
• schema also represents the relationship between these tables

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Schema diagram Example

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Schema diagram Example

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Data model: Underlying structure of a database.


o modelling of the data description, data relationships, semantics, and consistency constraints.
o provides a way to describe the design of a database at physical, logical, and view levels.

• Data models can be classified into four different categories:


o Relational Model.
o Entity-Relationship Model.
o Object-Based Data Model.
o Semi-structured Data Model.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Relational Model uses a collection of tables to represent both data and relationships among those data.
o Each table has multiple columns, and each column has a unique name.
o Tables are also known as relations.
o Relational model is an example of a record-based model.
o Each table contains records of a particular type.
• Entity-Relationship Model uses collection of basic objects/entities & relationships among these objects.
• Object-Based Data Model Object oriented programming (java, C++, C#) has led to development of
object-oriented data model that can be seen as extending E-R model with notions of encapsulation, methods
(functions), and object identity.
o Combines features of object-oriented data model and relational data model.
• Semi-structured Data Model permits specification of data where individual data items of the same type
may have different sets of attributes.
o Extensible Markup Language (XML) is widely used to represent semi-structured data

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Database Language
• DBMS has appropriate languages and interfaces to express database queries and updates.
• Database languages can be used to read, store and update data in database.

Types of Database Language


• DDL: Data Definition Language
• DML: Data Manipulation Language
• DCL: Data Control Language
• TCL: Transaction Control Language

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E
Data Definition Language (DDL)

• Used to define database structure or pattern.


• Used to create schema, tables, indexes, constraints, etc. in database.
• Using DDL statements, one can create skeleton of the database.
• DDL is used to store information of metadata (number of tables and schemas, their names, indexes, columns
in each table, constraints, etc.)
• SQL is a popular database language.

DDL tasks:
• Create: used to create objects in database.
• Alter: used to alter the structure of database.
• Drop: used to delete objects from database.
• Truncate: used to remove all records from a table.
• Rename: used to rename an object.
• Comment: used to comment on the data dictionary.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Data-manipulation language (DML):

• Language that enables users to access/manipulate data as organized by appropriate data model.
• Handles user requests.
• Types of access can be:
o Retrieval of information stored in database
o Insertion of new information into database
o Deletion of information from database
o Modification of information stored in database

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

Data-manipulation language (DML):

• Select: used to retrieve data from database.


• Insert: used to insert data into table.
• Update: used to update existing data within table.
• Delete: used to delete all records from table.
• Merge: performs UPSERT operation, i.e., insert or update operations.
• Call: used to call structured query language or Java subprogram.
• Explain Plan: has parameter of explaining data.
• Lock Table: controls concurrency.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Two classes of languages


o Procedural – user specifies what data is required and how to get those data
o Declarative (nonprocedural) – user specifies what data is required without specifying how to get
those data
• Declarative DMLs are usually easier to learn and use than procedural DMLs.
o Since user does not have to specify how to get data, the database system has to figure out an efficient
means of accessing data.
• Query: A statement requesting retrieval of information.
• Query language: Portion of a DML that involves information retrieval.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Database environment is a collective system of components that comprise and regulates group of data,
management, and use of data.
• Consist of software, hardware, people, techniques of handling database, and data.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC


I N T RO – DATA B A S E S Y S T E M & A RC H I T E C T U R E

• Hardware component of database system environment includes all physical devices that comprise database
system (includes storage devices, processors, input and output devices, printers, network devices, etc).
• Software component includes all software required to access, store and regulate database (operating
systems, DBMS and application programs and utilities).
• People component includes all the people who are related to database creation, management and usage.
Procedures component of database environment is nothing but function that regulates and controls use of
database.
• Data component include collection of related data which are known fact that can be recorded and it has an
implicit meaning in databsae.

SSS Shameem Mar-2022 Database Management, MSc.(BA), DOC

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy