Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
SQL Statements and Keywords
SQL statements are used to perform specific tasks in a database
SQL keywords are reserved words that have a specific meaning in SQL
SQL Syntax Components
SQL statements always end with a semicolon (;)
SQL is not case-sensitive
SQL Operations: Create, Read, Update, and Delete
CRUD operations:
CREATE: used to create new tables or databases
READ: used to retrieve data from a database
UPDATE: used to modify data in a database
DELETE: used to delete data from a database
Fundamentals of a Relational Database
Consists of one or more tables
Each table has a unique name
Tables are used to store data in a structured format
Joining Data Together with SQL Keywords
Data from multiple tables can be combined using SQL keywords such as JOIN,
INNER JOIN, LEFT JOIN, etc.
SQL in Relational Database Management Systems
SQL is used in relational database management systems (RDBMS) to interact
with a database
Examples of RDBMS: MySQL, Oracle, Microsoft SQL Server, etc.
, SQL in Relational Database Management Systems
SQL Operations
SQL operations can be categorized into four main groups: Create, Read,
Update, and Delete (CRUD).
Create: adding new data to the database
INSERT INTO
CREATE TABLE
CREATE DATABASE
Read: retrieving data from the database
SELECT
Update: modifying existing data in the database
UPDATE
Delete: removing data from the database
DELETE
Joining Data Together with SQL Keywords
SQL provides several keywords that can be used to combine data from
multiple tables into a single result set, including:
JOIN: used to combine rows from two or more tables based on a related
column
INNER JOIN: returns only the matching rows from both tables
LEFT JOIN: returns all rows from the left table and the matching rows from
the right table
RIGHT JOIN: returns all rows from the right table and the matching rows from
the left table