0% found this document useful (0 votes)
18 views14 pages

Introduction RDBMS

The document is a syllabus for an Introduction to RDBMS course covering topics such as database types, RDBMS architecture, keys, integrity constraints, and ER diagrams. It explains the structure and properties of databases, including tables, rows, and columns, as well as various types of keys and data integrity. Real-world examples illustrate the application of RDBMS in fields like banking, social media, and e-commerce.
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)
18 views14 pages

Introduction RDBMS

The document is a syllabus for an Introduction to RDBMS course covering topics such as database types, RDBMS architecture, keys, integrity constraints, and ER diagrams. It explains the structure and properties of databases, including tables, rows, and columns, as well as various types of keys and data integrity. Real-world examples illustrate the application of RDBMS in fields like banking, social media, and e-commerce.
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
You are on page 1/ 14

Syllabus – Introduction to RDBMS

Unit Topics Covered


1 What is a Database, Types of Databases (Relational, NoSQL, etc.)
2 RDBMS Architecture – Tables, Rows, Columns, Data Types
3 Keys: Primary Key, Foreign Key, Candidate Key, Composite Key
4 Relational Integrity Constraints
5 ER Diagrams and Relational Models
What is a Database?

A database is an organized collection of data that is stored and accessed


electronically. It is designed to efficiently store, retrieve, and manage
information.

Key Characteristics of a Database:

Feature Description
Data is stored in a specific format (like rows
Structured Data
and columns in tables).
Data remains stored even after the program ends
Persistent Storage
or system shuts down.
Data can be quickly searched, filtered, and
Efficient Access
updated.
Security and Access Permissions can restrict who can view or modify
Control the data.
Data can be backed up and restored in case of
Backup and Recovery
failure.
Types of Databases

Type Example Use Case


Relational
MySQL, Oracle – For structured data in tables
(RDBMS)
NoSQL MongoDB – For unstructured or semi-structured data
In-Memory Redis – For very fast, temporary storage
Neo4j – For data with complex relationships (like
Graph
social networks)
InfluxDB – For data indexed over time (IoT,
Time-Series
metrics)

Real-World Examples

 Banking systems store customer and transaction records.


 Social media platforms store user profiles, posts, and likes.
 E-commerce websites manage product listings and order histories.
Three-Level Architecture of RDBMS

a. External Level (View Level)


Users' view of the data
Defines what data a user can access

Provides security and customization (via Views)

Multiple external views can exist

Example: A student sees only their marks and profile, not others’.

b. Conceptual Level (Logical Level)


Describes the logical structure of the database
Includes tables, relationships, constraints

Managed by the DBMS schema

Independent of physical storage details

Example: Tables like Students, Courses, Marks and how they relate.
c. Internal Level (Physical Level)
Defines how data is actually stored in memory
Includes indexes, file formats, compression, hashing

Managed by DBMS engine

Example: How rows are stored in disk blocks or in memory.


What is table/Relation?
Everything in a relational database is stored in the form of relations. The
RDBMS database uses tables to store data. A table is a collection of
related data entries and contains rows and columns to store data. Each
table represents some real-world objects such as person, place, or event
about which information is collected. The organized collection of data
into a relational table is known as the logical view of the database.

Properties of a Relation:

Each relation has a unique name by which it is identified in the database.


Relation does not contain duplicate tuples.
The tuples of a relation have no specific order.
All attributes in a relation are atomic, i.e., each cell of a relation contains
exactly one value.
What is a row or record?
A row of a table is also called a record or tuple. It contains the specific
information of each entry in the table. It is a horizontal entity in the table.
For example, The above table contains 5 records.

Properties of a row:
No two tuples are identical to each other in all their entries.
All tuples of the relation have the same format and the same number of
entries.
The order of the tuple is irrelevant. They are identified by their content,
not by their position.

Let's see one record/row in the table.

1 Ajeet 24 B.Tech
What is a column/attribute?
A column is a vertical entity in the table which contains all information
associated with a specific field in a table. For example, "name" is a
column in the above table which contains all information about a
student's name.

Properties of an Attribute:
Every attribute of a relation must have a name.
Null values are permitted for the attributes.
Default values can be specified for an attribute automatically inserted if
no other value is specified for an attribute.
Attributes that uniquely identify each tuple of a relation are the primary
key.
Types of Keys in RDBMS
1. ✅ Primary Key
A unique identifier for each record in a table.

Cannot have NULL or duplicate values.

There can be only one primary key per table.

Example:

CREATE TABLE Students (


RollNo INT PRIMARY KEY,
Name VARCHAR(50)
);
Here, RollNo is the Primary Key.

2. Foreign Key
A key used to link two tables.

It is a field (or collection of fields) in one table that refers to the primary
key in another table.

Can have duplicate and NULL values.

Example:

CREATE TABLE Departments (


DeptID INT PRIMARY KEY,
DeptName VARCHAR(50)
);

CREATE TABLE Employees (


EmpID INT PRIMARY KEY,
Name VARCHAR(50),
DeptID INT,
FOREIGN KEY (DeptID) REFERENCES Departments(DeptID)
);
DeptID in Employees is a Foreign Key.
3. Candidate Key
Any column (or set of columns) that can uniquely identify a row in a
table.

There can be multiple candidate keys in a table.

One candidate key is chosen as the Primary Key.

Example:
In a Users table:

Email, Username, and UserID could all be Candidate Keys.

One of them is chosen as the Primary Key.

4. Composite Key
A primary key that consists of two or more columns.

Used when a single column is not sufficient to uniquely identify a record.

Example:

CREATE TABLE Enrollments (


StudentID INT,
CourseID INT,
EnrollmentDate DATE,
PRIMARY KEY (StudentID, CourseID)
);
The combination of StudentID and CourseID is a Composite Primary Key.
Data Integrity
There are the following categories of data integrity exist with each
RDBMS:

Entity integrity: It specifies that there should be no duplicate rows in a


table.

Domain integrity: It enforces valid entries for a given column by


restricting the type, the format, or the range of values.

Referential integrity specifies that rows cannot be deleted, which are used
by other records.

User-defined integrity: It enforces some specific business rules defined


by users. These rules are different from the entity, domain, or referential
integrity.
What is an ER Diagram?
An ER (Entity-Relationship) Diagram is a visual tool used to design databases by
modeling:

You might also like