You are on page 1of 10

What is a relational database?

A relational database is a type of database that stores and provides access to data points that are related to one
another. It uses a structure that allows us to identify and access data in relation to another piece of data in the
database.
Key concepts of relational databases
Data Organization Data Integrity Query Flexibility
Relational databases Relational databases ensure Relational databases allow
organize data into tables, data integrity through the for complex queries that
making it easy to access and use of constraints and enable users to retrieve
manage information. relationships. specific data sets efficiently.
Tables and Rows
Tables Rows

Tables in a relational database are used to organize Rows, also known as records, are individual entries
and store data. Each table represents an entity, with within a table. Each row contains data related to the
each row containing the specific information for that specific attributes or columns of the table.
entity.
Columns and Data Types
Columns in a relational database represent the
different categories of information. Each column has
a specific data type, such as text, number, or date.
Primary keys and foreign keys
Primary Keys Foreign Keys
Primary keys uniquely identify each record Foreign keys establish relationships
in a table. between tables.

Referential Integrity
Foreign keys ensure data consistency between related tables.
Relationships between tables
Primary Key-Foreign Key Relationship
Establishes a link between tables based on the values of related fields.

One-to-One Relationship
Each record in the first table is related to only one record in the second table.

One-to-Many Relationship
Each record in the first table is related to multiple records in the second table.
SQL (Structured Query
Language)
SQL, often referred to as Structured Query Language, is the standard language
for accessing and managing databases. It allows users to retrieve, insert, update,
and delete data in a database. SQL is essential for database management and is
widely used in various industries for data analysis and reporting.
Basic SQL queries
• SELECT statement: Used to retrieve data from a database table.
• INSERT statement: Adds new rows of data into a table.
• UPDATE statement: Modifies existing data in a table.
SELECT Statement
The SELECT statement is used to retrieve data from a database. It allows you to specify the columns to be selected
and the conditions for filtering the rows. You can also use it to perform calculations and aggregate functions on the
data.

Additionally, the SELECT statement is fundamental to querying and analyzing data in a relational database
management system (RDBMS) using SQL.

When using the SELECT statement, you can also join tables, create subqueries, and apply sorting and grouping to
the result set.
The INSERT Statement
An INSERT statement is used to add new records to a table in a relational
database.

It specifies the table to insert into and the values to be inserted into the specified
columns.

You might also like