0% found this document useful (0 votes)
13 views38 pages

Database Systems: Architecture & Models

The document outlines the architecture and data models of database systems, detailing concepts such as data, information, databases, and Database Management Systems (DBMS). It discusses the advantages and disadvantages of DBMS, compares file systems with DBMS, and describes various types of DBMS architectures, including single-tier, two-tier, and three-tier architectures. Additionally, it introduces the three-schema architecture, emphasizing data abstraction and its benefits in managing complex data structures.

Uploaded by

donaayush2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views38 pages

Database Systems: Architecture & Models

The document outlines the architecture and data models of database systems, detailing concepts such as data, information, databases, and Database Management Systems (DBMS). It discusses the advantages and disadvantages of DBMS, compares file systems with DBMS, and describes various types of DBMS architectures, including single-tier, two-tier, and three-tier architectures. Additionally, it introduces the three-schema architecture, emphasizing data abstraction and its benefits in managing complex data structures.

Uploaded by

donaayush2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Unit 1: Database System Architecture and Data Models

Syllabus :
Database system architecture: Data Abstraction, Data Independence, Data Definition
Language(DDL),Data Manipulation Language(DML).
Data models: Entity Relationship Model, network model, relational and object oriented data
models, integrity constraints, data manipulation operations.
Prepared By Deepak Mod [[Link] CSE SAITM]

Basic Terms:

1. Data:
●​ Definition: Data refers to raw facts and figures that are unprocessed and lack context. It
can be in the form of numbers, text, images, or any other format. Data by itself doesn't
convey meaning and requires interpretation to become useful.
●​ Example: Numbers such as "5," "7.3," or words like "apple," "red," are examples of data.

2. Information:
●​ Definition: Information is data that has been processed, organised, or structured in a way
that gives it context, meaning, and relevance. Information provides insights and answers
questions, making it useful for decision-making.
●​ Example: A statement like "There are 5 apples in the basket, and 3 of them are red" is
information derived from the data provided.

3. Database:
●​ Definition: A database is a structured collection of data that is organised and stored for
efficient retrieval, manipulation, and management. Databases can consist of tables,
records, and fields, and they are designed to store and organise data for specific
purposes.
●​ Example: An online store's database might contain tables for products, customers,
orders, and reviews, each storing relevant information.

4. Database Management System (DBMS):


●​ A Database Management System (DBMS) is a software application or system that
provides tools and services for creating, managing, and interacting with databases.
●​ It provides interfaces for users and applications to interact with a database. It acts as an
intermediary between the user and the database, managing tasks like data storage,
retrieval, security, and data integrity.
●​ Example: Popular DBMS software includes MySQL, Oracle Database, Microsoft SQL
Server, and PostgreSQL, NoSQL(MongoDB) which help users manage data effectively
in various applications.

In summary, data is the raw information, information is data with context and meaning, a
database is a structured collection of data, and a Database Management System (DBMS) is
software that facilitates the creation and management of databases, allowing users to work with
data efficiently.

Applications of Database Management Systems (DBMS) :


1.​ Data Storage and Retrieval:
●​ DBMSs store and organise large volumes of data efficiently.
●​ Users can retrieve specific data quickly using structured queries, reducing
manual data searching.
2.​ Business Decision Support:
●​ DBMSs enable data analysis and reporting.
●​ Businesses use DBMSs to make informed decisions based on trends, patterns,
and insights from their data.
3.​ E-commerce and Online Transactions:
●​ DBMSs manage product catalogs, customer data, and transaction records for
e-commerce websites.
●​ They ensure data accuracy, security, and fast transaction processing.
4.​ Customer Relationship Management (CRM):
●​ DBMSs centralize customer information, interactions, and preferences.
●​ CRM systems use DBMSs to enhance customer service and tailor marketing
efforts.
5.​ Healthcare Record Management:
●​ DBMSs securely store patient records, medical histories, and treatment plans.
●​ They facilitate quick access to critical health information for medical
professionals.

Advantages of DBMS:
1.​ Data Centralization: DBMS allows data to be stored in a centralized location, making it
easily accessible to multiple users and applications. This prevents data redundancy and
inconsistency.
2.​ Data Sharing and Security: DBMS enables controlled access to data, ensuring data
security and privacy. It allows multiple users to access and manipulate data concurrently
while maintaining integrity through access control mechanisms.
3.​ Data Integrity and Consistency: DBMS provides mechanisms for enforcing data integrity
rules, ensuring the accuracy and consistency of data stored in the database.
4.​ Data Independence: Users and applications are shielded from the underlying database
structure. Changes made to the database's structure (schema) do not affect the
applications using the data.
5.​ Data Recovery and Backup: DBMS systems offer backup and recovery solutions to
safeguard against data loss due to hardware failures, human errors, or disasters.
6.​ Concurrency Control: DBMS manages concurrent access to data, preventing conflicts
and ensuring that transactions are processed in an isolated and consistent manner.
7.​ Efficient Query Processing and Reporting: DBMS optimizes queries and provides tools
for generating reports, allowing users to extract information and perform complex
analysis efficiently.
8.​ Scalability and Performance: DBMS systems can efficiently handle large volumes of data
and scale to meet growing data demands with enhanced performance.

Disadvantages of DBMS:
1.​ Complexity and Cost: Setting up and maintaining a DBMS can be complex and
expensive. It requires skilled personnel for installation, configuration, maintenance, and
troubleshooting.
2.​ Overhead and Performance Impact: DBMS systems introduce some overhead due to
data processing, management, and security mechanisms. This can impact system
performance compared to using flat files for simple applications.
3.​ Security Concerns: While DBMS offers security features, there's always a risk of security
breaches. Improperly configured access control or vulnerabilities in the DBMS itself can
lead to unauthorized access and data breaches.
4.​ Dependency on DBMS Vendor: Organizations relying on a specific DBMS vendor might
face challenges if that vendor discontinues support or goes out of business. Migration to
another system can be costly and time-consuming.
5.​ Lack of Flexibility: The structure of a database might not be as flexible as flat files.
Making changes to the structure, especially in large systems, can be challenging and
might impact existing applications.
6.​ Performance Tuning Complexity: Optimizing a DBMS for specific applications or
workloads can be complex and requires a deep understanding of the system's inner
workings.
7.​ Data Inconsistency Risk: In some cases, with large, distributed systems or improper
configuration, there might be inconsistencies in data due to factors like network delays or
failures in synchronization.

File System vs DBMS


A file system is a method or structure used by computers and operating systems to organize
and store data and files on storage devices like hard drives, solid-state drives (SSDs), and
removable media (e.g., USB drives). It provides a hierarchical structure for data storage, making
it easy for users and software to access, manage, and organise files and directories.

●​ File System: Stores files in folders, lacks organisation. Example: Storing photos in
folders on a computer.
●​ DBMS: Organises data in structured tables for easy retrieval. Example: Storing customer
information in a database for a business.
Tabular comparison between a File System and a Database Management System (DBMS):

Database Management System


Aspect File System (DBMS)

Organises data in tables with rows


Organises data in files and
Data Structure and columns, providing a structured
folders, typically hierarchical.
format.

Often leads to data redundancy Minimises data redundancy through


Data Redundancy (duplicate copies) because files normalisation techniques and
are self-contained. relational tables.

Relies on external application Enforces data integrity through


Data Integrity programs for data integrity and constraints, such as primary keys and
validation. foreign keys.

Retrieving specific data can be Provides a query language (e.g.,


Data Retrieval complex, requiring custom code SQL) for easily retrieving data based
for searching and filtering. on specified criteria.

Maintenance tasks are typically Offers automated tools and utilities for
Data Maintenance manual and depend on the data maintenance tasks, such as data
application. cleaning and transformation.

Data Abstraction Absent in file system. Present in DBMS.

Security relies on file and Provides robust security features,


Security directory permissions, which can including user authentication,
be limited. authorization, and auditing.

Scaling to accommodate larger Offers scalability options for handling


Scalability data volumes and multiple users large datasets and high concurrent
can be challenging. user loads.

May not handle concurrent Manages concurrent access with


Concurrent Access
access well, leading to potential locks and transactions to ensure data
(Concurrency)
data inconsistencies. consistency.

Supports the establishment of


Limited support for defining and
relationships between tables,
Data Relationships maintaining complex data
enabling complex queries and data
relationships.
modeling.

Provides logical data independence,


Data Independence Applications are tightly coupled
allowing changes in data structure
(Logical) with file formats and structures.
without affecting applications.

Provides physical data independence,


Data Independence Applications may break if file
allowing changes in data storage
(Physical) locations or formats change.
without affecting applications.
Offers automated backup and
Requires manual backup and
Data Backup and recovery mechanisms for entire
recovery processes for individual
Recovery databases, ensuring data
files.
consistency.

In summary, while a File System is a basic method for organising and storing data, a Database
Management System (DBMS) provides a more structured and efficient approach for managing
data, offering features like data integrity, security, concurrent access control, and support for
complex data relationships. DBMS is particularly well-suited for applications that require data
consistency, scalability, and ease of data retrieval.

Database System Architecture


Database System Architecture refers to the structure and components of a database
management system (DBMS) that work together to manage and store data efficiently.
A typical DBMS architecture includes various layers and components that interact to provide
users with efficient and secure data storage and retrieval.

Components of Database System Architecture:


1.​ User Interface: This component allows users and applications to interact with the
database system. It includes forms, menus, and graphical interfaces that facilitate data
entry and retrieval.
2.​ Application Programs: These are software applications that communicate with the
database system. They send queries and transactions to the database and process the
results. Examples include web applications, mobile apps, and desktop software.
3.​ DBMS (Database Management System): The DBMS is the heart of the database
system. It manages and controls the database, ensuring data integrity, security, and
efficient access. Popular DBMSs include MySQL, PostgreSQL, Oracle, and Microsoft
SQL Server.
4.​ Database: The database is the repository where data is organized and stored. It can
consist of tables, documents, graphs, or other data structures, depending on the data
model used.
5.​ Database Engine: The database engine is the core of the DBMS. It handles data
storage, retrieval, and management. It translates high-level queries into low-level
operations for efficient data access.

Types of Database System Architecture:


There are several types of DBMS architecture, each with its own advantages and use cases.
Here are the most common types:
1.​ Single-Tier (Single-Layer) Architecture:
○​ Definition: In a single-tier architecture, also known as a flat or monolithic
architecture, all the components of the DBMS, including the user interface,
application logic, and database management functions, are tightly integrated into
a single software package. It runs on a single machine.

○​ Advantages:
■​ Simplicity: Easier to develop and manage for small applications.
■​ Lower hardware and software costs.
■​ Suitable for single-user running local applications.
○​ Disadvantages:
■​ Limited scalability: Difficult to scale for larger databases or multiple users.
■​ Lack of security: Limited access control and security features.
■​ Maintenance challenges: Any changes require modifications to the entire
system.

2.​ Two-Tier (Client-Server) Architecture:


○​ Definition: In a two-tier architecture, the DBMS is divided into two layers: the
client or front-end layer and the server or back-end layer. The client handles the
user interface and application logic, while the server manages the database.
These two layers communicate over a network through internet or APIs. It runs
on different machines.

○​ Advantages:
■​ Improved scalability: Can handle multiple users and larger databases.
■​ Enhanced security: Access control can be implemented at the server
level.
■​ Easier maintenance: Changes to the client or server can be made
independently.
○​ Disadvantages:
■​ Limited flexibility: Scaling beyond a certain point can be challenging.
■​ Performance issues: Heavy client-server communication may lead to
latency.

3.​ Three-Tier Architecture:


○​ Definition: A three-tier architecture further separates the DBMS into three layers:
the presentation layer (client), the application/business layer (middle tier), and the
data layer (server). The presentation layer handles the user interface, the
application layer manages business logic, and the data layer stores and retrieves
data.
○​ Client Layer: Contains the UI part of our application. This layer is used for the
design purpose where data is presented to the user or input is taken from the
user.
○​ Business Layer: All business logic written like validation of data, calculations,
data insertion etc. This acts as an interface between Client layer and Data
Access Layer. Make communication faster between client and data layer.
○​ Data Layer: Actual database comes in the picture. Contains methods to connect
with the database and to perform insert, update, delete, get data from the
database based on our input data.

○​ Advantages:
■​ Scalability: Easily scales for a larger number of users and increased data
volumes.
■​ Flexibility: Each tier can be developed and maintained independently.
■​ Improved security: Access control can be implemented at multiple levels.
○​ Disadvantages:
■​ Complexity: Requires careful design and management of multiple
components.
■​ Increased development effort: Developing and maintaining three layers
can be more time-consuming.

Three Schema Architecture of DBMS


The three schema architecture describes how the data is represented or viewed by the user in
the database. This architecture is also known as three-level architecture.
The three schema architecture divides the database into three-level to create a separation
between the physical database and the user application. In simple words, this architecture hides
the details of physical storage from the user. The database administrator (DBA) should be able
to change the structure of database storage without affecting the user’s view.​

This architecture contains three layers or levels of the database management system:
1.​ External level
2.​ Conceptual level
3.​ Internal level
1.​ External or View level:
This is the highest level of abstraction where the actual view of data relevant to a
particular user or a group of users is defined. It provides different views of the same
database, allowing for a customized perspective for each user.

2.​ Conceptual or Logical level:


The conceptual level serves as a middle layer between the physical storage and the
user's view. It describes the overall structure of the database, specifying what data is
stored, the relationships among the data, and the data types.

3.​ Internal or Physical level:


This is the lowest level of abstraction that deals with the physical storage details of the
database. It describes how data is actually stored and provides methods to access data.

Advantages of Three-schema Architecture


1.​ Abstraction: It abstracts the details of how data is physically stored, making the database
system easier to use for end-users.
2.​ Customized Views: Users can access the same database with different customized
views, tailored to their specific needs.
3.​ Flexibility in Database Changes: Enables the database administrator to change the
storage structure without affecting users, providing adaptability to evolving storage
technologies.
4.​ Enhanced Security: Provides a flexible and powerful security mechanism by allowing the
hiding of specific database parts from users, enhancing data security.
5.​ Ease of Maintenance: Changes in the physical storage structure are transparent to
application programs and users, simplifying maintenance procedures.
Data Abstraction
Definition: Data abstraction is the process of simplifying complex data structures into a more
manageable and understandable form for users and applications.

●​ The primary goal of data abstraction is to achieve data independence, reducing the time
and cost required for modifications or alterations to the database.

Data abstraction is a concept in computer science that simplifies complex systems by hiding
unnecessary details and showing only the essential parts to the user. It allows you to focus on
what something does rather than how it does it.

●​ Think of it as using a TV remote control without needing to know how the internal
electronics work—you just press buttons to change channels, adjust the volume, and so
on.

Levels of Data Abstraction:


There are mainly 3 levels of data abstraction:
1.​ Physical or Internal Level
2.​ Logical or Conceptual Level
3.​ View or External Level

1.​ Physical or Internal Level:


This is the lowest level of data abstraction, focusing on how data is actually stored in
memory or on storage devices. It deals with access methods (sequential, random), file
organization (B+ trees and hashing), and the technical details of storage (usability,
memory size).
Example: Storing employee details involves knowledge of how data is physically stored
in terms of blocks and memory allocation, but these details are hidden from the user.
2.​ Logical or Conceptual Level:
This level of data abstraction Involves the actual organization of data stored in the
database using tables, attributes, and relationships. It abstracts the physical storage
details and presents a more structured view, without specifying how data is stored
internally.
Example: Storing employee attributes and their relationships, such as reporting to a
manager, is managed at the logical level.

3.​ View or External Level:


This is the highest level of abstraction, presenting a simplified and tailored view of the
database to individual users. It allows users to interact with the database by providing
data customization and simplified interface, ensuring that users see only the portions of
the data that are relevant to their tasks.
Example: Users accessing customer data may see a simplified view with specific fields
relevant to their needs, without being exposed to the intricacies of physical or logical
storage.

Data Independence
Data independence is the property that allows changes in one level of data abstraction to not
affect the other levels. Data independence refers to the separation of the logical and physical
aspects of data within a database system, providing several benefits.

Data independence is a critical concept in database design and management as it minimizes


the impact of changes and optimizations, making database systems more adaptable and easier
to maintain over time. It also contributes to the overall efficiency and robustness of a database
system.

There are two types of data independence:


1.​ Physical Independence: Changes in the physical storage do not affect the conceptual or
external levels.
2.​ Logical Independence: Changes in the conceptual schema do not affect the external
schema.
1.​ Physical Data Independence: Physical data independence allows changes to the
internal (physical) schema without impacting the conceptual schema. For example, If we
alter the storage structure (e.g., switch from magnetic disks to solid-state drives), the
conceptual schema remains unchanged. Applications interacting with the conceptual
schema won’t need modifications due to this physical change.

2.​ Logical Data Independence: Logical data independence allows modifications to the
conceptual (logical) schema without affecting the external schema.. In other words,
modifications to the database schema, such as adding new tables, altering existing
ones, or changing relationships, do not require rewriting or modifying the application
code that accesses the data. For example, if we add a new attribute to a table in the
conceptual schema. Logical data independence ensures that users’ views (external
schema) remain unaffected. For instance, if we add a “phone number” field to the
conceptual schema, existing applications using the external schema won’t break.

DBA (Database Administrator):


●​ Definition: A Database Administrator (DBA) is a professional responsible for the design,
implementation, operation, maintenance, and security of a database management
system (DBMS). DBAs play a crucial role in ensuring that databases are efficient,
available, and secure.

Functions of a DBA:
1.​ Database Design and Implementation:
●​ DBAs are involved in the initial design and structure of the database. They
determine how data should be organised, relationships between tables, and data
integrity constraints. They also oversee the implementation of the database
schema.​

2.​ Performance Tuning:


●​ DBAs monitor database performance, identifying and addressing bottlenecks or
inefficiencies. They optimise queries, configure indexes, and fine-tune database
parameters to ensure optimal response times.

3.​ Data Backup and Recovery:


●​ DBAs are responsible for creating regular backups of the database to prevent
data loss due to system failures or human errors. They also develop and test
disaster recovery plans to restore data in case of a catastrophic event.

4.​ Security and Access Control:


●​ DBAs manage data security by setting up access controls, authentication, and
authorization mechanisms. They ensure that only authorised users can access
and modify data, protecting it from unauthorised access or breaches.

5.​ Database Maintenance and Upgrades:


●​ DBAs perform routine maintenance tasks such as database defragmentation,
data consistency checks, and software patching. They plan and oversee
database upgrades to newer versions of the DBMS software to take advantage of
new features and improvements.

Structured Query Language (SQL)


SQL (Structured Query Language) is a specialised programming language used for managing
and manipulating relational databases . SQL provides a standardised way to interact with
databases, allowing users to perform tasks such as querying, updating, inserting, and deleting
data.
SQL can be categorised into several types based on its functionality:

1.​ Data Query Language (DQL):


●​ Purpose: DQL is used for retrieving data from a database.
●​ Key Statements: SELECT
●​ Example:
SELECT FirstName, LastName FROM Customers WHERE Country =
'USA';

2.​ Data Definition Language (DDL):


●​ Purpose: DDL is used for defining and managing the structure of a database and
its objects.
●​ Key Statements: CREATE, ALTER, DROP, TRUNCATE, and others.
●​ Example:
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
Name VARCHAR(255),
Salary DECIMAL(10, 2)
);

3.​ Data Manipulation Language (DML):


●​ Purpose: DML is used for manipulating data stored in the database.
●​ Key Statements: INSERT, UPDATE, DELETE, MERGE, and others.
●​ Example:
INSERT INTO Products (ProductName, Price) VALUES ('Laptop', 999.99);

4.​ Data Control Language (DCL):


●​ Purpose: DCL is used for controlling access to data within the database.
●​ Key Statements: GRANT, REVOKE
●​ Example:
GRANT SELECT ON Customers TO User1;

5.​ Transaction Control Language (TCL):


●​ Purpose: TCL is used for managing transactions within a database.
●​ Key Statements: COMMIT, ROLLBACK, SAVEPOINT
●​ Example:
BEGIN TRANSACTION;
UPDATE Inventory SET Quantity = Quantity - 1 WHERE ProductID = 101;
COMMIT;

Data Definition Language (DDL)


Data Definition Language (DDL) is a subset of SQL (Structured Query Language) used for
defining and managing the structure and schema of a database. DDL statements are used to
create, modify, and delete database objects like tables, indexes, and constraints.

DDL Commands:
1.​ CREATE TABLE: Defines a new table with its columns, data types, and constraints.
Syntax:
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
...
);

​ Example:
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
FirstName VARCHAR(20),
LastName VARCHAR(20),
DepartmentID INT
);

EmployeeID FirstName LastName DepartmentID

1 Deepak Modi 101

2 Ritvik Barnwal 102

3 Sumit Kumar 103

2.​ ALTER TABLE: Modifies an existing table's structure by adding, modifying, or dropping
columns or constraints.
Syntax:
ALTER TABLE table_name
ADD column_name datatype;
Example:
ALTER TABLE Employees
ADD Salary DECIMAL(10, 2);

EmployeeID FirstName LastName DepartmentID Salary

1 Deepak Modi 101 55000.00

2 Ritvik Barnwal 102 60000.00

3 Sumit Kumar 103 48000.00

3.​ DROP TABLE: Deletes a table and its data from the database.
Syntax:
DROP TABLE table_name;​
Example:
DROP TABLE Employees;
(table is removed, and data is deleted)

4.​ TRUNCATE : Remove all rows from a table while keeping the table's structure intact.
Syntax:
TRUNCATE TABLE table_name;
Example:
TRUNCATE TABLE Employees;
​ ​ (all rows are removed, but the table structure remains)
EmployeeID FirstName LastName DepartmentID Salary
5.​ CREATE INDEX: Creates an index on one or more columns of a table to improve query
performance.
Syntax:
CREATE INDEX index_name
ON table_name (column1, column2, ...);

Example:
CREATE INDEX idx_LastName ON Employees(LastName);

(table structure remains, but an index is created to improve query performance)



6.​ CREATE VIEW: Defines a virtual table based on the result of a query. Views are often
used for data abstraction and security.​
Example:
CREATE VIEW EmployeeNames AS
SELECT FirstName, LastName
FROM Employees;

FirstName LastName

Deepak Modi

Ritvik Barnwal

Sumit Kumar

Data Manipulation Language (DML)


Data Manipulation Language (DML) is a subset of SQL (Structured Query Language) used to
interact with and manipulate data stored in a relational database management system
(RDBMS). It allows users to perform various operations on the data, such as retrieving,
inserting, updating, and deleting records within database tables.

DML Commands:
1.​ SELECT: Retrieves data from one or more tables based on specified criteria.​
Example:
Suppose we have a table named "Employees" with the following data:
EmployeeID FirstName LastName DepartmentID

1 John Doe 101

2 Jane Smith 102


3 Michael Johnson 101

The SQL SELECT statement retrieves data from the "Employees" table based on
specified criteria:
SELECT FirstName, LastName
FROM Employees
WHERE DepartmentID = 101;

​ Result:
FirstName LastName

John Doe

Michael Johnson

2.​ INSERT INTO: Adds new records to a table.​
Example:
We can use the INSERT INTO command to add a new record to the "Employees" table:
INSERT INTO Employees (EmployeeID, FirstName, LastName,
DepartmentID)
VALUES (1, 'John', 'Doe', 101);

​ Now, our "Employees" table will look like this:


EmployeeID FirstName LastName DepartmentID

1 John Doe 101

2 Jane Smith 102

3 Michael Johnson 101

4 Emily Brown 102



3.​ UPDATE: Modifies existing records in a table.​
Example:
Let's say we want to update the salary of employee ID 1:
UPDATE Employees
SET Salary = 60000
WHERE EmployeeID = 1;
​ After the update, the "Employees" table will remain the same, but the salary of John Doe
will be changed to $60,000.
4.​ DELETE FROM: Removes records from a table based on specified conditions.​
Example:
Suppose we want to remove employee ID 2 from the "Employees" table:
DELETE FROM Employees
WHERE EmployeeID = 2;

After this DELETE operation, the "Employees" table will look like this:
EmployeeID FirstName LastName DepartmentID

1 John Doe 101

3 Michael Johnson 101

4 Emily Brown 102

DDL vs DML
Tabular comparison of Data Definition Language (DDL) and Data Manipulation Language
(DML):

Aspect Data Definition Language (DDL) Data Manipulation Language (DML)

Defines and manages database Performs operations to manipulate


Purpose
structure and schema. the data stored in the database.

Includes statements like CREATE, Includes statements like SELECT,


ALTER, DROP, TRUNCATE, and INSERT, UPDATE, DELETE, and
Main Statements
others for defining and modifying others for retrieving, adding,
database objects. modifying, and deleting data.

Operates on database objects like Operates on data within tables,


Object of
tables, views, indexes, and specifying what data to retrieve,
Operation
schemas. modify, or delete.

Alters the structure of the database,


Modifies the content of the database,
Outcome adding or removing objects and
querying or changing data records.
constraints.

CREATE TABLE, ALTER TABLE, SELECT, INSERT INTO, UPDATE,


Examples
DROP INDEX, CREATE VIEW. DELETE FROM.

Directly affects data by retrieving,


Does not change data but changes
Impact on Data adding, modifying, or deleting
the database structure.
records.

Often executed after DDL statements


Can be executed independently of
Dependency to set up the schema for DML
DML statements.
operations.
Typically not within a transaction, as
Transaction Typically part of a transaction and can
DDL statements are
Management be rolled back if necessary.
auto-committed.

In summary, DDL focuses on defining and managing the database structure, objects, and
constraints, while DML deals with retrieving, adding, modifying, and deleting data stored within
the database. These two subsets of SQL serve different purposes and operate on different
aspects of database management.

Data Models
Data Model: A data model is a conceptual representation of data and its relationships.
Data models define the logical and physical structure of data in a database. They serve as a
blueprint for designing and implementing a database system.

Different models are used for different purposes:

1. Entity-Relationship Model (ER Model)


●​ Explanation: The Entity-Relationship Model (ER Model) is a visual representation used
to design and conceptualise databases. It focuses on entities (objects or concepts),
relationships between entities, and attributes (properties) that make up a database.
●​ Key Components:
○​ Entities: Represent real-world objects or concepts. For example, in a university
database, "Student" and "Course" are entities.
○​ Attributes: Describe properties or characteristics of entities. For a "Student,"
attributes could be "StudentID," "Name," and "DateOfBirth."
○​ Relationships: Define how entities are related to each other. For instance,
"Student" entities can be related to "Course" entities through a "Registration"
relationship.
●​ Example: Consider a library database:
○​ Entities: Students, Books, Authors.
○​ Attributes: Students have IDs, Names; Books have Titles, ISBNs; Authors have
Names.
○​ Relationships: Students borrow Books; Books are written by Authors.
●​ ER diagrams visually represent entities, attributes, and relationships, making it easier to
understand the database structure and its connections.

●​ Reducing ER Diagrams to Tables


Once an ER model has been created, it can be converted into a set of relational
database tables. Each entity in the ER model is converted into a table, and each
relationship is converted into a foreign key constraint between the tables.
Steps for Reducing ER Diagrams to Tables
1.​ Identify the entities and relationships in the ER diagram.
2.​ Create a table for each entity.
3.​ Identify the primary key for each table. The primary key is a unique identifier for
each row in the table.
4.​ Create foreign key constraints to represent the relationships between the tables.
A foreign key constraint is a column in one table that references the primary key
of another table.
5.​ Normalize tables to remove redundancy and organize data efficiently.

●​ Use of ER Diagrams In DBMS


○​ Easily convertible to relations (tables).
○​ Models real-world objects.
○​ No technical knowledge required.
○​ Easy to understand and create.
○​ Provides a standard solution for logical data visualization.

●​ Symbols Used in ER Model


ER Model is used to model the logical view of the system from a data perspective which
consists of these symbols:
○​ Rectangles: Represent Entities.
○​ Ellipses: Represent Attributes.
○​ Diamonds: Represent Relationships.
○​ Lines: Connect attributes and entities.
○​ Double Ellipses: Represent Multi-Valued Attributes.
○​ Double Rectangle: Represents a Weak Entity.

●​ Components of ER Diagram
ER Model consists of Entities, Attributes, and Relationships among Entities in a
Database System.
Entity
An entity represents an object with either a physical existence (e.g., a person, car, house) or a
conceptual existence (e.g., a company, job, university course).
Entity Set: An entity is an object of an entity type, and a set of all entities of the same type is
called an entity set. For example, E1 is an entity with the entity type "Student," and the set of all
students is the entity set. In an ER diagram, the entity type is represented by a rectangle.

1. Strong Entity
●​ A strong entity has a key attribute.
●​ It does not depend on other entities in the schema.
●​ It has a primary key for unique identification, represented by a rectangle.

2. Weak Entity
●​ A weak entity type has a key attribute that uniquely identifies each entity in the set.
●​ It exists only in the context of another entity, known as the identifying strong entity type.
●​ Represented by a double rectangle, and the relationship is an identifying relationship
represented by a double diamond.

For Example, A company may store the information of dependents (Parents, Children, Spouse)
of an Employee. But the dependents don’t have existed without the employee. So Dependent
will be a Weak Entity Type and Employee will be Identifying Entity type for Dependent, which
means it is Strong Entity Type.
A weak entity type is represented by a Double Rectangle. The participation of weak entity types
is always total. The relationship between the weak entity type and its identifying strong entity
type is called identifying relationship and it is represented by a double diamond.

Attributes
Attributes are the properties that define the entity type. For example, Roll_No, Name, DOB,
Age, Address, and Mobile_No are the attributes that define entity type Student. In ER diagram,
the attribute is represented by an oval.

1. Key Attribute
The attribute which uniquely identifies each entity in the entity set is called the key attribute. For
example, Roll_No will be unique for each student. In ER diagram, the key attribute is
represented by an oval with underlying lines.

2. Composite Attribute
An attribute composed of many other attributes is called a composite attribute. For example, the
Address attribute of the student Entity type consists of Street, City, State, and Country. In ER
diagram, the composite attribute is represented by an oval comprising of ovals.
3. Multivalued Attribute
An attribute consisting of more than one value for a given entity. For example, Phone_No (can
be more than one for a given student). In ER diagram, a multivalued attribute is represented by
a double oval.

4. Derived Attribute
An attribute that can be derived from other attributes of the entity type is known as a derived
attribute. e.g.; Age (can be derived from DOB). In ER diagram, the derived attribute is
represented by a dashed oval.

The Complete Entity Type Student with its Attributes can be represented as:

Relationship Type and Relationship Set


A Relationship Type represents the association between entity types. For example, 'Enrolled in'
is a relationship type between the Student and Course entity types. In an ER diagram, the
relationship type is represented by a diamond connecting entities with lines.
Entity-Relationship Set
A set of relationships of the same type is known as a relationship set. For example, the
relationship set depicts S1 enrolled in C2, S2 enrolled in C1, and S3 registered in C3.

Degree of a Relationship Set


The number of different entity sets participating in a relationship set is called the degree of a
relationship set.
1. Unary Relationship: When there is only ONE entity set participating in a relation, the
relationship is called a unary relationship. For example, one person is married to only one
person.

2. Binary Relationship: When there are TWO entities set participating in a relationship, the
relationship is called a binary relationship. For example, a Student is enrolled in a Course.
3. n-ary Relationship: When there are n entities set participating in a relation, the relationship
is called an n-ary relationship.

Cardinality
The number of times an entity of an entity set participates in a relationship set is known as
cardinality. Cardinality can be of different types:

1. One-to-One: When each entity in each entity set can take part only once in the relationship,
the cardinality is one-to-one. Let us assume that a male can marry one female and a female can
marry one male. So the relationship will be one-to-one.
Total number of tables that can be used in this is 2.

Using Sets, it can be represented as:

2. One-to-Many: In one-to-many mapping as well where each entity can be related to more
than one relationship and the total number of tables that can be used in this is 2. Let us assume
that one surgeon deparment can accomodate many doctors. So the Cardinality will be 1 to M. It
means one deparment has many Doctors.
Total number of tables that can used is 3.

Using sets, one-to-many cardinality can be represented as:


3. Many-to-One: When entities in one entity set can take part only once in the relationship set
and entities in other entity sets can take part more than once in the relationship set, cardinality
is many to one. Let us assume that a student can take only one course but one course can be
taken by many students. So the cardinality will be n to 1. It means that for one course there can
be n students but for one student, there will be only one course.
The total number of tables that can be used in this is 3.

Using Sets, it can be represented as:

In this case, each student is taking only 1 course but 1 course has been taken by many
students.

4. Many-to-Many: When entities in all entity sets can take part more than once in the
relationship cardinality is many to many. Let us assume that a student can take more than one
course and one course can be taken by many students. So the relationship will be many to
many.
the total number of tables that can be used in this is 3.

Using Sets, it can be represented as:

In this example, student S1 is enrolled in C1 and C3 and Course C3 is enrolled by S1, S3, and
S4. So it is many-to-many relationships.

How to Draw ER Diagram ?


●​ The very first step is Identifying all the Entities, and place them in a Rectangle, and
labeling them accordingly.
●​ The next step is to identify the relationship between them and pace them accordingly
using the Diamond, and make sure that, Relationships are not connected to each other.
●​ Attach attributes to the entities properly.
●​ Remove redundant entities and relationships.
●​ Add proper colors to highlight the data present in the database.

2. Network Model
●​ Explanation: The Network Model represents data as a collection of records connected
through network-like structure with nodes (records) and links (relationships). The
Network Model organises data as records (nodes) linked by relationships (arcs).
Records can have multiple parent and child nodes, allowing complex data structures.
●​ It's more flexible than the hierarchical model and allows for complex data structures.
Unlike the hierarchical model, it allows records to have multiple parent and child records.
●​ Key Components:
○​ Nodes (Records): Represent entities or records.
○​ Links (Relationships): Define associations between nodes.
○​ Sets: Group nodes of the same type.
○​ Owner Record: A record can be an owner or member in multiple sets, allowing
for complex relationships.
●​ Example: In a manufacturing database:
○​ Nodes: Parts, Suppliers, Orders.
○​ Links: Parts are supplied by Suppliers; Orders contain Parts.
○​ Sets: Parts Set, Suppliers Set, Orders Set.
●​ Flexibility: The Network Model can represent complex relationships more naturally than
the hierarchical model.

3. Relational Model ​
●​ Explanation: The relational model organises data into tables (relations) consisting of
rows (tuples) and columns (attributes). It's widely used in modern databases and
focuses on data integrity and consistency.
●​ Key Components:
1.​ Tables (Relations):
●​ Tables store data records.
●​ Each table represents a specific entity or concept.
●​ Example: In an online store, tables could include Customers, Products, and
Orders.
2.​ Rows (Tuples):
●​ Rows represent individual data records within a table.
●​ Each row contains data related to a specific instance of the entity represented by
the table.
3.​ Columns (Attributes):
●​ Columns define data fields within a table.
●​ Each attribute holds a specific type of information (e.g., name, ID, price).
●​ Example: Customers table might have columns for ID and Name.
4.​ Primary Keys:
●​ Primary keys are unique identifiers for rows in a table.
●​ They ensure each row can be uniquely identified.
●​ Example: ID column in the Customers table can be a primary key.
5.​ Foreign Keys:
●​ Foreign keys establish relationships between tables.
●​ They link the primary key of one table to the corresponding column in another
table.
●​ Example: Orders table might have a foreign key referencing the Customers table.

●​ Example: In an online store database:


○​ Tables: Customers, Products, Orders.
○​ Attributes: Customers have IDs, Names; Products have IDs, Names, Prices;
Orders have IDs, Dates.
○​ Relationships: Customers place Orders for Products.
●​ Normalization: The Relational Model encourages data normalization, reducing data
redundancy and maintaining data integrity.
●​ Example:
| EmployeeID | FirstName | LastName | DepartmentID |
| 1 | John | Doe | 101 |

Keys
In the context of databases, Keys are attributes or sets of attributes (columns) that are used to
identify and access records within a table. It is widely used to identify the tuples(rows) uniquely
in the table.
Keys are one of the basic requirements of a relational database model that play essential roles
in organising and managing data.
They are used to ensure data integrity, establish relationships between tables, and facilitate
efficient data retrieval.

Types Of Keys :

1.​ Primary Key:


●​ A Primary Key is a special type of key in a relational database that serves as the
main method for uniquely identifying individual records (tuples) within a table.
●​ It enforces the uniqueness and integrity of the data by ensuring that no two
records in the table can have the same value for the primary key attribute.
●​ Additionally, a primary key attribute cannot contain null values, as it must be
unique for each record.
●​ Example: Let's consider a "Students" table within a university database. This
table contains information about students, including their unique StudentID, First
Name, Last Name, and Date of Birth. In this case, the StudentID attribute is
chosen as the primary key.
Students Table:
StudentID FirstName LastName DateOfBirth

1001 John Doe 1998-05-15


1002 Jane Smith 1997-09-20

1003 David Brown 1999-02-10

1004 Sarah Wilson 1998-12-05


In this example:
●​ "StudentID" is chosen as the primary key, as it uniquely identifies each student in the
table.
●​ It enforces the rule that no two students can have the same StudentID.
●​ "StudentID" cannot contain null values, ensuring that each student's identification is
complete and unique.

2.​ Foreign Key:


●​ A Foreign Key (FK) is an attribute or a set of attributes in a relational database
table that establishes a link or relationship between that table and another table.
●​ The foreign key references the primary key in another table, creating a
connection between the two tables.
●​ This relationship enforces referential integrity, ensuring that data remains
consistent and accurate.
●​ Example: Consider two tables, "Students" and "Courses," within a university
database. In this example, the "Courses" table includes a foreign key that
references the "StudentID" primary key in the "Students" table, creating a
relationship between students and the courses they are enrolled in.
Students Table:
StudentID FirstName LastName DateOfBirth

1001 John Doe 1998-05-15

1002 Jane Smith 1997-09-20

1003 David Brown 1999-02-10

1004 Sarah Wilson 1998-12-05

Courses Table:
CourseID CourseName StudentID

C101 Mathematics 101 1001

C102 History 101 1002

C103 Science 101 1001

C104 Literature 101 1003

In this example:
●​ The "StudentID" column in the "Students" table is the primary key that uniquely identifies
each student.
●​ In the "Courses" table, the "StudentID" column is a foreign key. It establishes a
relationship between the "Courses" table and the "Students" table by referencing the
primary key in the "Students" table.
●​ The foreign key enforces that the values in the "StudentID" column of the "Courses"
table must match values in the "StudentID" column of the "Students" table.
●​ This ensures that only valid student IDs can be associated with courses. Any attempt to
insert a value in the "StudentID" column of the "Courses" table that does not exist in the
"Students" table would be rejected, maintaining referential integrity.

3.​ Candidate Key:
●​ A Candidate Key in a relational database is a set of one or more attributes (columns)
that can uniquely identify each tuple (row) within a table.
●​ Unlike the Primary Key, which is chosen as the main method for uniquely identifying
records in a table, a Candidate Key is any attribute or combination of attributes that
satisfies the uniqueness constraint. In essence, a Candidate Key represents a potential
choice for the Primary Key.
●​ Here's an example of a Candidate Key:
Consider a "Students" table within a university database. This table contains information about
students, including unique StudentID, Email, and Social Security Number (SSN) attributes. In
this case, both StudentID and SSN can be considered Candidate Keys because they can
uniquely identify each student.

Students Table:
StudentID FirstName LastName Email SSN

1001 John Doe john@[Link] 123-45-6789

1002 Jane Smith jane@[Link] 987-65-4321

1003 David Brown david@[Link] 456-78-9012

1004 Sarah Wilson sarah@[Link] 789-12-3456

In this example:
●​ Both "StudentID" and "SSN" can serve as Candidate Keys because they are capable of
uniquely identifying each student in the table.
●​ "Email" could also be considered a Candidate Key if it is required to be unique for each
student.
It's important to note that while both "StudentID" and "SSN" can serve as Candidate Keys, only
one of them would typically be chosen as the Primary Key. The Primary Key is the attribute that
is selected to be the primary means of uniquely identifying records in the table, and it cannot
contain null values.
4.​ Super Key:
●​ A Super Key in a relational database is a set of one or more attributes (columns) that
can be used to uniquely identify each tuple (row) within a table.
●​ Unlike the Primary Key, which is the chosen attribute that uniquely identifies records in a
table, a Super Key is a broader concept that encompasses all possible combinations of
attributes that could potentially provide uniqueness.
●​ Here's an example of a Super Key:
Consider a "Students" table within a university database. This table contains information about
students, including StudentID, FirstName, LastName, and Date of Birth. In this case, a Super
Key could be composed of a combination of attributes such as "StudentID" and "FirstName."

Students Table:
StudentID FirstName LastName DateOfBirth

1001 John Doe 1998-05-15

1002 Jane Smith 1997-09-20

1003 David Brown 1999-02-10

1004 Sarah Wilson 1998-12-05

In this example:
●​ The combination of "StudentID" and "FirstName" forms a Super Key because it can
potentially provide uniqueness. However, it may not be minimal, as it includes more
attributes than needed.
●​ Other combinations of attributes, such as "StudentID" and "DateOfBirth," or "FirstName"
and "DateOfBirth," could also form Super Keys.
●​ A Super Key can include a single attribute or multiple attributes, and it encompasses all
possible ways to uniquely identify records.

5.​ Alternate Key:


An Alternate Key in a relational database is a candidate key that was not chosen to be the
primary key. It is an attribute or combination of attributes that can uniquely identify each tuple
(row) within a table but is not designated as the primary means of identifying records. Alternate
keys provide additional options for uniquely identifying data in a table.
Here's an example of an Alternate Key:
Consider a "Students" table within a university database, similar to previous examples. This
table contains information about students, including unique StudentID, Email, and Social
Security Number (SSN) attributes. In this case, both StudentID and SSN can be considered
candidate keys and, therefore, alternate keys.

Students Table:
StudentID FirstName LastName Email SSN
1001 John Doe john@[Link] 123-45-6789

1002 Jane Smith jane@[Link] 987-65-4321

1003 David Brown david@[Link] 456-78-9012

1004 Sarah Wilson sarah@[Link] 789-12-3456

In this example:
●​ Both "StudentID" and "SSN" can serve as alternate keys because they are capable of
uniquely identifying each student in the table.
●​ While "StudentID" may be chosen as the primary key, "SSN" remains a candidate key
and is also considered an alternate key.
●​ "Email" could also be considered an alternate key if it is required to be unique for each
student.

6.​ Composite Key:


A Composite Key, also known as a compound key, is a type of key in a relational database that
consists of two or more attributes (columns) working together to uniquely identify each tuple
(row) within a table. Unlike a single-attribute key, a composite key combines multiple attributes
to achieve uniqueness. Composite keys are useful when no single attribute can uniquely identify
records on its own.
Here's an example of a Composite Key:
Consider an "Order Details" table within an e-commerce database. This table tracks the details
of orders, and each order is identified by a combination of "OrderID" and "ProductID." In this
case, the combination of these two attributes forms a composite key.

Order Details Table:


OrderID ProductID Quantity UnitPrice

1001 A123 5 29.99

1001 B456 3 14.95

1002 A123 2 29.99

1003 C789 1 49.99

In this example:
●​ The combination of "OrderID" and "ProductID" forms a composite key that uniquely
identifies each record in the "Order Details" table.
●​ While "OrderID" alone may not be unique (multiple orders can have the same product),
the combination of both attributes ensures uniqueness.

7.​ Secondary Key:


●​ A Secondary Key, in the context of a relational database, is an attribute or a set of
attributes that is not designated as the primary key but is still used for querying and
indexing purposes.
●​ While a secondary key does not serve as the primary means of uniquely identifying
records in a table, it can significantly enhance the efficiency of data retrieval and provide
alternative access paths to the data.
●​ Here's an example of a Secondary Key:
Consider an "Employees" table within a human resources database. This table contains
information about employees, including attributes like EmployeeID (the primary key),
EmployeeName, Email, and Department.

Employees Table:
EmployeeID EmployeeName Email Department

1001 John Doe john@[Link] HR

1002 Jane Smith jane@[Link] IT

1003 David Brown david@[Link] Finance

1004 Sarah Wilson sarah@[Link] Marketing

In this example:
●​ "EmployeeID" is the primary key, uniquely identifying each employee in the table.
●​ "Email" is a secondary key, which is not the primary means of identification, but it can be
used for efficient data retrieval and as an alternative access path.
●​ By creating an index on the "Email" attribute, users can quickly locate an employee's
record by searching for their email address.

3. Object-Oriented Data Model ​


●​ The Object-Oriented Data Model treats data as objects with properties (attributes) and
methods (functions). It's used for representing complex, real-world objects and their
relationships.
●​ Key Components:
○​ Objects: Represent entities or instances.
○​ Attributes: Define object properties.
○​ Methods: Include functions or behaviours that objects can perform.
○​ Inheritance: Objects can inherit attributes and behaviours from other objects.
●​ Example: In a university database:
○​ Objects: Professors, Courses, Students.
○​ Attributes: Professors have Names, Courses have Titles, Students have Names.
○​ Methods: Professors can teach Courses; Students can enroll in Courses.
●​ Application: Object-Oriented Data Models are suitable for complex systems like
simulations, scientific modeling, and real-world object representation.
Integrity Constraints
Integrity constraints are a set of rules and conditions imposed on data in a database to ensure
its accuracy, consistency, and reliability. They are a fundamental part of maintaining the quality
and integrity of the data within a database.
Types of Integrity Constraints:

1. Entity Integrity Constraint


●​ Entity Integrity Constraint ensures that the primary key attribute (or combination of
attributes) in a table uniquely identifies each row and that it does not contain NULL
values.
●​ Ensures that the primary key attribute(s) in a table are unique and not null. This prevents
duplicate or missing key values.
●​ Example:
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL
);
●​ In this example, the "StudentID" column is the primary key, ensuring each student is
uniquely identified. The "NOT NULL" constraint ensures that both the first name and last
name must have values (no NULLs).

2. Referential Integrity Constraint


●​ Referential Integrity Constraint maintains the consistency of relationships between tables
by ensuring that foreign key values in one table correspond to primary key values in
another table.
●​ Ensures that foreign key values in one table correspond to the primary key values in
another table. This maintains the integrity of relationships between tables.
●​ Example:
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
CustomerID INT,
OrderDate DATE,
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
);
●​ In this example, the "CustomerID" column in the "Orders" table is a foreign key that
references the "CustomerID" primary key in the "Customers" table. This ensures that
orders are associated with existing customers.
3. Domain Integrity Constraint
●​ Domain Integrity Constraint defines rules for the data type and format of individual
attributes (columns) in a table, ensuring that data values are within acceptable ranges
and formats.
●​ Example:
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Salary DECIMAL(10, 2) CHECK (Salary >= 0)
);
●​ In this example, the "Salary" column must have a value greater than or equal to 0, as
specified by the CHECK constraint.

4. Check Constraint
●​ Check Constraints allow you to specify custom conditions for data values in a table,
ensuring that only data meeting specific criteria are allowed.
●​ Example:
CREATE TABLE Products (
ProductID INT PRIMARY KEY,
ProductName VARCHAR(100),
Price DECIMAL(10, 2) CHECK (Price > 0),
StockQuantity INT CHECK (StockQuantity >= 0)
);
●​ Here, the CHECK constraints ensure that the "Price" is greater than 0, and the
"StockQuantity" is non-negative.

5. Unique Constraint
●​ Unique Constraints enforce uniqueness for a column or a combination of columns,
preventing duplicate values.
●​ Example:
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
Email VARCHAR(100) UNIQUE,
SSN VARCHAR(11) UNIQUE
);
●​ In this example, both the "Email" and "SSN" columns must contain unique values.

6. Default Constraint
●​ Explanation: Default Constraints provide a default value for a column when no value is
specified during an insert operation.
●​ Example:
CREATE TABLE Tasks (
TaskID INT PRIMARY KEY,
TaskName VARCHAR(100),
Priority INT DEFAULT 1
);
●​ In this example, if no priority is provided when inserting a new task, it will default to 1.

Assignment 1

1.​ What is the role of Database Administrator?


2.​ What do you mean by Database and Database Management System?
3.​ What are the problems with the traditional file processing system?
4.​ Explain the advantages of DBMS over Traditional File System.
5.​ What do you mean by Data processing?
6.​ What do you mean by instance & schema? Explain the difference between these.
7.​ What are the various components of a database system?
8.​ What is the role of three levels of Data Abstraction?
9.​ What is relation in DBMS? What is the difference between a table and an attribute?
10.​Write a short note on data independence.

MDU Previous Year Questions


1.​ Explain the following
a.​ Data
b.​ Database Language
c.​ Data independence
d.​ Data warehousing and data mining
e.​ Components of DBMS
f.​ Relation in DBMS
g.​ Relational model
h.​ ER diagram
i.​ Referential integrity constraint
j.​ Tuples and attributes
2.​ Describe DBMS. Explain the advantages of DBMS over file processing systems.
3.​ Define file. Give a complete description about file organisation.
4.​ Explain the responsibilities of Database Administrator.
5.​ Explain the three level architecture of Database Administrators.
6.​ Explain, what do you understand by the Entity Relationship Diagram ?
7.​ Differentiate between DBMS and file processing systems.
8.​ Describe the various views of data.
9.​ Explain the following: (a) mapping constraint (b) reduction of ER diagram into tables.
10.​Differentiate between DBMS and file processing system.
11.​What is a Database Management System? Explain 3 tier architecture database
management system in detail.
12.​Explain various types of DDL, DML and DCL languages in detail.
13.​How is DDL different from DML? Give different types of DML.
14.​Explain the difference between physical and logical data independence.
15.​Explain the types of data models in detail with suitable examples.
16.​Write a short note on: (a) DDL (b) Data Abstraction.
17.​Explain the following : (a)Relational Data Model (b) Relational Algebra.

You might also like