0% found this document useful (0 votes)
39 views2 pages

Rel Dbs

Relational databases organize data into tables with rows and columns to store and manage structured data. Tables contain records made of attributes, with primary keys uniquely identifying each row. Structured Query Language (SQL) is used to perform queries, joins, and data manipulation. Relational databases enforce data integrity through constraints and normalization to minimize redundancy and dependency between tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views2 pages

Rel Dbs

Relational databases organize data into tables with rows and columns to store and manage structured data. Tables contain records made of attributes, with primary keys uniquely identifying each row. Structured Query Language (SQL) is used to perform queries, joins, and data manipulation. Relational databases enforce data integrity through constraints and normalization to minimize redundancy and dependency between tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

# Class Notes: Relational Databases

## Introduction to Relational Databases


Relational Databases are a mechanism for storing and managing structured data. They
are based on the relational model of data, as proposed by E.F. Codd in 1970. This
model organizes data into one or more tables (or relations) of rows and columns,
with a unique key identifying each row.

## Components of a Relational Database

### Tables
- Tables are the basic structure in a relational database, each containing rows and
columns.
- Each row represents a record (or tuple) and each column represents an attribute
(or field) of the record.
- The intersection of a row and column is a specific data value.

### Keys
- Keys are used to uniquely identify each row in a table.
- Primary Key: A column (or a set of columns) that uniquely identifies each row in
the table.
- Foreign Key: A set of columns in a table that refers to the primary key in
another table. It establishes a link between the two tables.

## Structured Query Language (SQL)

### SELECT Statement


The SELECT statement is used to retrieve data from one or more tables. It allows
you to specify the columns you want to retrieve, apply filters, and perform
calculations on the data.

Example:
SELECT first_name, last_name FROM employees WHERE department = 'IT';

### JOINs
Joins are used to retrieve data from multiple tables based on a related column
between them. Common types of joins include INNER JOIN, LEFT JOIN, and RIGHT JOIN.

Example:
SELECT orders.order_id, customers.customer_name
FROM orders
INNER JOIN customers ON orders.customer_id = customers.customer_id;

### Data Manipulation Language (DML)


SQL includes commands for manipulating data in a relational database. This includes
INSERT, UPDATE, and DELETE statements.

## Data Integrity
Relational databases enforce data integrity through various constraints, including:
- Entity Integrity: Ensuring each row in a table is uniquely identifiable through a
primary key.
- Referential Integrity: Ensuring the consistency of data between related tables
using foreign keys.
- Domain Integrity: Enforcing the validity of data based on defined data types and
constraints.

## Normalization
Normalization is the process of organizing the columns and tables of a relational
database to minimize data redundancy and dependency. This helps to ensure data
integrity and reduce anomalies during data manipulation.

## Conclusion
Relational databases have been a foundational technology for managing structured
data. They provide a powerful and flexible way to store and retrieve data while
maintaining data integrity. Understanding the principles of relational databases is
crucial for anyone working with data in IT, development, or related fields.

Remember, these are just the basics! There's a lot more to explore in the world of
relational databases.

You might also like