0% found this document useful (0 votes)
27 views7 pages

Understanding Relational Databases and DBMS

The document provides an overview of relational databases, including their structure, advantages, and the role of Database Management Systems (DBMS). It explains key concepts such as Data Definition Language (DDL) and Data Manipulation Language (DML), as well as the differences between two-tier and three-tier architectures. Additionally, it covers relational algebra, its basic operators, and examples of queries involving selection and projection.

Uploaded by

priyoshi.adc.23
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)
27 views7 pages

Understanding Relational Databases and DBMS

The document provides an overview of relational databases, including their structure, advantages, and the role of Database Management Systems (DBMS). It explains key concepts such as Data Definition Language (DDL) and Data Manipulation Language (DML), as well as the differences between two-tier and three-tier architectures. Additionally, it covers relational algebra, its basic operators, and examples of queries involving selection and projection.

Uploaded by

priyoshi.adc.23
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

Likely Question 1 (Marks: 2)

Q: What is a Relational Database?

Answer:​
A Relational Database is a type of database where all data is stored in the form of tables
(relations). Each table consists of rows (tuples) and columns (attributes). These tables are
connected through keys, allowing relationships between different sets of data.

Likely Question 2 (Marks: 4)


Q: What are the advantages of using a Database System?

Answer:​
Advantages of using a database system include:

1.​ Reduced data redundancy and inconsistency: Data is stored centrally, avoiding
duplication.​

2.​ Data isolation is minimized: Data is stored in separate files or tables.​

3.​ Improved data integrity: Constraints (e.g., salary > 0) can be enforced more easily.​

4.​ Atomicity of updates: (indivisible), null for unknown.​

5.​ Support for concurrent access: Multiple users can access data simultaneously without
conflict.​

6.​ Better security: Access control allows only authorized users to view or modify certain
data.​
1. a) Justification: DBMS manages extensive data access

A Database Management System (DBMS) is specifically designed to handle large volumes of


data efficiently and support various types of queries and transactions. Here’s how:

●​ Concurrency Control: Allows multiple users to access and modify data simultaneously
without conflicts.​

●​ Data Integrity and Security: Enforces rules and ensures only authorized access to
sensitive information.​

●​ Efficient Query Processing: Optimizes complex queries using indexing, query


optimization, and execution plans.​

●​ Data Recovery: Maintains logs and backups to recover data after crashes.​

●​ Scalability: Handles growing data and user load through techniques like partitioning and
replication.

✅ Example: A banking system with millions of transactions daily can be managed using a
DBMS like Oracle or MySQL.

1. b) Difference between DDL and DML


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

Purpose Defines structure/schema of the Manipulates data within the schema


database

Examples CREATE, ALTER, DROP INSERT, UPDATE, DELETE, SELECT

Affects Structure of tables, databases Data/contents of the tables

Rollback Generally not rollback-able Can be rollbacked

Execution Auto-commit changes Needs commit to save changes


1. c) Common Architechture of DBMS
View Level
|
Logical Level​
|
Physical Level​

1. d) Two-Tier vs. Three-Tier Architectures


Feature Two-Tier Architecture Three-Tier Architecture

Layers Client – Database Server Client – Application Server –


Database Server

Direct DB Yes (Client communicates directly No (App server handles DB


Access with DB) communication)

Scalability Limited More scalable

Security Less secure More secure (app layer controls


access)
Maintenance More complex on client side Easier maintenance due to
separation

2. a) Define Relational Algebra and its Basic Operators

Relational Algebra is a formal language used to query and manipulate relations (tables) in a
relational database. It operates on relations (sets of tuples) and produces new relations as
results.

🧮 Basic Operators:
1.​ Selection (σ) – Filters rows based on conditions​

2.​ Projection (π) – Selects specific columns​

3.​ Union (∪) – Combines tuples from two relations​

4.​ Set Difference (-) – Tuples in one relation but not the other​

5.​ Cartesian Product (×) – Combines every tuple from two relations​

6.​ Rename (ρ) – Renames relations or attributes​


7.​ Join (⨝) – Combines tuples from two relations based on a condition​

2. b) Relational Algebra: Salary > 50000


plaintext
CopyEdit
π_name, salary (σ_salary > 50000 (Employees))

●​ σ filters rows where salary > 50000​

●​ π projects only the name and salary columns​

2. c) Relational Algebra: Students Enrolled in CSE3107


plaintext
CopyEdit
π_Name (σ_CourseID='CSE3107' (Students ⨝ [Link] =
[Link] Enrollments))

●​ Join Students and Enrollments on StudentID​

●​ Selection: CourseID = 'CSE3107'​

●​ Projection: Only Name​

2. d) Union vs. Intersection in Relational Algebra


Operation Union (∪) Intersection (∩)

Output All tuples that are in either relation Only tuples present in both
relations

Condition Both relations must have same attributes and Same requirement as Union
domains
Use case Combine two sets of data Find common data

Duplicates Removes duplicates (set-based) Naturally shows common data


only

✅ Example:​
Let​
R = {(1, 'Alice'), (2, 'Bob')}​
S = {(2, 'Bob'), (3, 'Charlie')}

●​ R ∪ S = {(1, 'Alice'), (2, 'Bob'), (3, 'Charlie')}​

●​ R ∩ S = {(2, 'Bob')}​

Likely Questions 4
You might also be asked:

●​ Q: What is the difference between DDL and DML?​

○​ DDL (Data Definition Language) is used to define the schema (e.g., CREATE
TABLE).​

○​ DML (Data Manipulation Language) is used to query and update data (e.g.,
SELECT, INSERT).​

●​ Q: What are the different Key?​

○​ Superkey: uniquely identifies tuples (e.g., {ID, Name})


○​ Candidate key: minimal superkey (e.g., {ID})
○​ Primary key: one candidate key chosen
○​ Foreign key: refers to another table (e.g., dept_name in instructor → department)
.​

●​ Q: What is the difference between Logical and Physical Schema?​

○​ Logical Schema: Describes the structure of the database.​

○​ Physical Schema: Describes how data is stored on disk.​

●​ Q: Show an example combining Select and Project.​


○​ Query: Get the names of instructors in the Physics department.​
Answer: ∏ name (σ dept_name = "Physics" (instructor))

You might also like