0% found this document useful (0 votes)
46 views

Structured Query Language (SQL) : It9 - Adbms

SQL is a language used to manage data in relational database management systems. It has two main components: DDL for defining data structures and DML for manipulating data records. JOIN operations allow data to be retrieved from two or more tables based on related columns and are used to combine rows. There are four main types of JOINs - INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN - that return different result sets depending on whether matching values are found in one or both tables.

Uploaded by

Marvin Bucsit
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Structured Query Language (SQL) : It9 - Adbms

SQL is a language used to manage data in relational database management systems. It has two main components: DDL for defining data structures and DML for manipulating data records. JOIN operations allow data to be retrieved from two or more tables based on related columns and are used to combine rows. There are four main types of JOINs - INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN - that return different result sets depending on whether matching values are found in one or both tables.

Uploaded by

Marvin Bucsit
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Structured Query

Language (SQL)
IT9 - ADBMS
SQL
 Data Definition Language (DDL)
◦ Data structure – Database, Tables, Fields
 CREATE
 ALTER
 DROP
 Data Manipulation Language (DML)
◦ Record Management
 INSERT INTO
 UPDATE
 DELETE
 SELECT
HOW TO
SELECT
RECORDS
FROM TWO
OR MORE
TABLES?
JOIN
◦ is used to combine
rows from two or
more tables, based
on a related column
between them

◦ purpose is to bind
data together,
across tables
TYPES OF SQL JOIN
 INNER JOIN
 LEFT (OUTER) JOIN
 RIGHT (OUTER) JOIN
 FULL (OUTER) JOIN
TYPES OF SQL JOIN
 INNER JOIN SELECT column_name
◦ Return records that FROM table1
have matching INNER JOIN table2 
values on
both tables ON table1.column_name 
= table2.column_name;
TYPES OF SQL JOIN
 LEFT (OUTER) JOIN SELECT column_name
◦ Return all records FROM table1
from the left table, LEFT JOIN table2 
and the matched
records from the ON table1.column_name 
right table = table2.column_name;
TYPES OF SQL JOIN
 RIGHT (OUTER) JOIN SELECT column_name
◦ Return all records FROM table1
from the right table, RIGHT JOIN table2 
and the matched
records from the ON table1.column_name 
left table = table2.column_name;
TYPES OF SQL JOIN
 FULL (OUTER) JOIN SELECT column_name
◦ Return all records FROM table1
when there is a FULL OUTER JOIN table2 
match
in either left or right ON table1.column_name 
table = table2.column_name;

You might also like