SlideShare a Scribd company logo
K.Warawut SQL Overview 1
SQL OverviewSQL Overview
Suan Dusit Rajabhat University Phitsanulok CampusSuan Dusit Rajabhat University Phitsanulok Campus
Mr.Warawut KhangkhanMr.Warawut Khangkhan
K.Warawut SQL Overview 2
กลมค สงกลมค สง SQLSQL
●
ค สงนย มขอมล (Data Definition Language:
DDL)
●
ค สงด เนนก รขอมล (Data Manipulation
Language: DML)
●
ค สงควบคมขอมล (Data Control Language:
DCL)
K.Warawut SQL Overview 3
ค สงด เนนก รกบขอมลค สงด เนนก รกบขอมล
(Data Manipulation Language: DML)(Data Manipulation Language: DML)
●
เปนกลมค สงทใชด เนนก รกบขอมลในฐ นขอมล
เชน ก รเพม ลบ ปรบปรง และเรยกดขอมล เปนตน
●
ค สงในกลมน%จะไมส ม รถเปลยนแปลง
โครงสร งของฐ นขอมลได
K.Warawut SQL Overview 4
ก รเพมขอมลในก รเพมขอมลใน TableTable
รปแบบ
INSERT INTO table-name [(col-1, ..., col-n)]
VALUES (value-1, ..., value-n);
K.Warawut SQL Overview 5
ก รแกไขขอมลในก รแกไขขอมลใน TableTable
รปแบบ
UPDATE table-name
SET col-1 = value-1, ..., col-n = value-n
[WHERE condition];
K.Warawut SQL Overview 6
ก รลบขอมลในก รลบขอมลใน TableTable
รปแบบ
DELETE FROM table-name
[WHERE condition];
K.Warawut SQL Overview 7
ก รเรยกดขอมลในก รเรยกดขอมลใน TableTable
รปแบบ
SELECT * | [DISTINCT] col-1, col-2, ..., col-n
FROM table-name
[WHERE condition]
[GROUP BY col-1, col-2, ..., col-n]
[HAVING condition]
[ORDER BY col-1, col-2, ..., col-n];
K.Warawut SQL Overview 8
ก รเรยกดขอมลม กกวก รเรยกดขอมลม กกว 1 Table1 Table
●
ตองมก รรวมขอมลจ กหล ยต ร งดวยก รใชค สง
JOIN
– Inner Join ไดแก Equijoin, Non-Equijoin, Cross
Join และ Self Join
– Outer Join ไดแก Left Outer Join, Right Outer
Join และ Full Outer Join
K.Warawut SQL Overview 9
EquijoinEquijoin
●
เปนก รจบคแถวทมขอมลตรงกนของ 2 ต ร ง ค+อ
มลกษณะเปนก รใชเคร+องหม ยเท กบ (=) ในก ร
จบค
●
รปแบบ
table-name1 INNER JOIN table-name2 ON
table-name1.col1 = table-name2.col2
K.Warawut SQL Overview 10
Example EquijoinExample Equijoin
SELECT Sales.SalesID, SFirstName, SLastName
FORM Sales INNER JOIN Orders
ON Sales.SalesID = Orders.SalesID
WHERE Orders.OrderDate = '2549-10-21';
K.Warawut SQL Overview 11
Contact usContact us
Mr.Warawut KhangkhanMr.Warawut Khangkhan
Social Media:
http://www.facebook.com/awarawut
http://twitter.com/awarawut
Web Site:
http://awarawut.blogspot.com
E-Mail:
awarawut@hotmail.com
Mobile:
083-0698-410

More Related Content

Viewers also liked

Equipo 9 plan nacional de desarrollo
Equipo 9 plan nacional de desarrolloEquipo 9 plan nacional de desarrollo
Equipo 9 plan nacional de desarrolloGustavoreavelasco
 
Prática curricular iv conversa preliminar - cópia
Prática curricular iv   conversa preliminar - cópiaPrática curricular iv   conversa preliminar - cópia
Prática curricular iv conversa preliminar - cópia
Valdemir Lopes Valdermir
 
11. història art segle xix
11. història art segle xix11. història art segle xix
11. història art segle xixjgutier4
 
The Journey To Allah
The Journey To AllahThe Journey To Allah
The Journey To Allahzakir2012
 
中国社交游戏年度报告 Cecilia
中国社交游戏年度报告 Cecilia中国社交游戏年度报告 Cecilia
中国社交游戏年度报告 CeciliaAppLeap Inc.
 
Psychological risks of videogame usage by Florian Rehbein
Psychological risks of videogame usage by Florian RehbeinPsychological risks of videogame usage by Florian Rehbein
Psychological risks of videogame usage by Florian RehbeinRealidades Virtuais
 
Amazônia uma historia de perdas e danos um futuro a re construir
Amazônia uma historia de perdas e danos  um futuro a  re  construirAmazônia uma historia de perdas e danos  um futuro a  re  construir
Amazônia uma historia de perdas e danos um futuro a re construir
Aline Correia
 
Computación
ComputaciónComputación
Computación
Kevenloaiza1996
 
Fósiles en león
Fósiles en leónFósiles en león
Fósiles en león
Albertowiiii
 
Codigo civil-para-el-estado-libre-y-soberano-de-puebla
Codigo civil-para-el-estado-libre-y-soberano-de-pueblaCodigo civil-para-el-estado-libre-y-soberano-de-puebla
Codigo civil-para-el-estado-libre-y-soberano-de-pueblapbpg
 

Viewers also liked (14)

Equipo 9 plan nacional de desarrollo
Equipo 9 plan nacional de desarrolloEquipo 9 plan nacional de desarrollo
Equipo 9 plan nacional de desarrollo
 
Prática curricular iv conversa preliminar - cópia
Prática curricular iv   conversa preliminar - cópiaPrática curricular iv   conversa preliminar - cópia
Prática curricular iv conversa preliminar - cópia
 
11. història art segle xix
11. història art segle xix11. història art segle xix
11. història art segle xix
 
The Journey To Allah
The Journey To AllahThe Journey To Allah
The Journey To Allah
 
中国社交游戏年度报告 Cecilia
中国社交游戏年度报告 Cecilia中国社交游戏年度报告 Cecilia
中国社交游戏年度报告 Cecilia
 
Psychological risks of videogame usage by Florian Rehbein
Psychological risks of videogame usage by Florian RehbeinPsychological risks of videogame usage by Florian Rehbein
Psychological risks of videogame usage by Florian Rehbein
 
Amazônia uma historia de perdas e danos um futuro a re construir
Amazônia uma historia de perdas e danos  um futuro a  re  construirAmazônia uma historia de perdas e danos  um futuro a  re  construir
Amazônia uma historia de perdas e danos um futuro a re construir
 
Computación
ComputaciónComputación
Computación
 
Alertanuevadroga
AlertanuevadrogaAlertanuevadroga
Alertanuevadroga
 
Premonsoonchitawan
PremonsoonchitawanPremonsoonchitawan
Premonsoonchitawan
 
Fósiles en león
Fósiles en leónFósiles en león
Fósiles en león
 
Codigo civil-para-el-estado-libre-y-soberano-de-puebla
Codigo civil-para-el-estado-libre-y-soberano-de-pueblaCodigo civil-para-el-estado-libre-y-soberano-de-puebla
Codigo civil-para-el-estado-libre-y-soberano-de-puebla
 
Fotógrafos
FotógrafosFotógrafos
Fotógrafos
 
Practica nº7
Practica nº7Practica nº7
Practica nº7
 

More from Warawut

Database design
Database designDatabase design
Database design
Warawut
 
Business Computer Project 4
Business Computer Project 4Business Computer Project 4
Business Computer Project 4
Warawut
 
Object-Oriented Programming 10
Object-Oriented Programming 10Object-Oriented Programming 10
Object-Oriented Programming 10
Warawut
 
Object-Oriented Programming 9
Object-Oriented Programming 9Object-Oriented Programming 9
Object-Oriented Programming 9
Warawut
 
Object-Oriented Programming 8
Object-Oriented Programming 8Object-Oriented Programming 8
Object-Oriented Programming 8
Warawut
 
Object-Oriented Programming 7
Object-Oriented Programming 7Object-Oriented Programming 7
Object-Oriented Programming 7
Warawut
 
Object-Oriented Programming 6
Object-Oriented Programming 6Object-Oriented Programming 6
Object-Oriented Programming 6
Warawut
 
Management Information System 6
Management Information System 6Management Information System 6
Management Information System 6
Warawut
 
Management Information System 5
Management Information System 5Management Information System 5
Management Information System 5
Warawut
 
Management Information System 4
Management Information System 4Management Information System 4
Management Information System 4
Warawut
 
Object-Oriented Programming 5
Object-Oriented Programming 5Object-Oriented Programming 5
Object-Oriented Programming 5
Warawut
 
Business Computer Project 3
Business Computer Project 3Business Computer Project 3
Business Computer Project 3
Warawut
 
Management Information System 3
Management Information System 3Management Information System 3
Management Information System 3
Warawut
 
Chapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemChapter 2 Strategy & Information System
Chapter 2 Strategy & Information System
Warawut
 
Object-Oriented Programming 4
Object-Oriented Programming 4Object-Oriented Programming 4
Object-Oriented Programming 4
Warawut
 
Business Computer Project 1
Business Computer Project 1Business Computer Project 1
Business Computer Project 1
Warawut
 
Chapter 1 Organization & MIS
Chapter 1 Organization & MISChapter 1 Organization & MIS
Chapter 1 Organization & MIS
Warawut
 
Object-Oriented Programming 3
Object-Oriented Programming 3Object-Oriented Programming 3
Object-Oriented Programming 3
Warawut
 
Object-Oriented Programming 2
Object-Oriented Programming 2Object-Oriented Programming 2
Object-Oriented Programming 2
Warawut
 
Object-Oriented Programming 1
Object-Oriented Programming 1Object-Oriented Programming 1
Object-Oriented Programming 1
Warawut
 

More from Warawut (20)

Database design
Database designDatabase design
Database design
 
Business Computer Project 4
Business Computer Project 4Business Computer Project 4
Business Computer Project 4
 
Object-Oriented Programming 10
Object-Oriented Programming 10Object-Oriented Programming 10
Object-Oriented Programming 10
 
Object-Oriented Programming 9
Object-Oriented Programming 9Object-Oriented Programming 9
Object-Oriented Programming 9
 
Object-Oriented Programming 8
Object-Oriented Programming 8Object-Oriented Programming 8
Object-Oriented Programming 8
 
Object-Oriented Programming 7
Object-Oriented Programming 7Object-Oriented Programming 7
Object-Oriented Programming 7
 
Object-Oriented Programming 6
Object-Oriented Programming 6Object-Oriented Programming 6
Object-Oriented Programming 6
 
Management Information System 6
Management Information System 6Management Information System 6
Management Information System 6
 
Management Information System 5
Management Information System 5Management Information System 5
Management Information System 5
 
Management Information System 4
Management Information System 4Management Information System 4
Management Information System 4
 
Object-Oriented Programming 5
Object-Oriented Programming 5Object-Oriented Programming 5
Object-Oriented Programming 5
 
Business Computer Project 3
Business Computer Project 3Business Computer Project 3
Business Computer Project 3
 
Management Information System 3
Management Information System 3Management Information System 3
Management Information System 3
 
Chapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemChapter 2 Strategy & Information System
Chapter 2 Strategy & Information System
 
Object-Oriented Programming 4
Object-Oriented Programming 4Object-Oriented Programming 4
Object-Oriented Programming 4
 
Business Computer Project 1
Business Computer Project 1Business Computer Project 1
Business Computer Project 1
 
Chapter 1 Organization & MIS
Chapter 1 Organization & MISChapter 1 Organization & MIS
Chapter 1 Organization & MIS
 
Object-Oriented Programming 3
Object-Oriented Programming 3Object-Oriented Programming 3
Object-Oriented Programming 3
 
Object-Oriented Programming 2
Object-Oriented Programming 2Object-Oriented Programming 2
Object-Oriented Programming 2
 
Object-Oriented Programming 1
Object-Oriented Programming 1Object-Oriented Programming 1
Object-Oriented Programming 1
 

Recently uploaded

แนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdf
แนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdfแนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdf
แนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdf
Faculty of BuddhismMahachulalongkornrajavidyalaya Roi Et Buddhist College
 
atwordfamily words with Thai translationtx
atwordfamily words with Thai translationtxatwordfamily words with Thai translationtx
atwordfamily words with Thai translationtx
Bangkok, Thailand
 
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf
สุเมธี​​​​ ตี่พนมโอรัล / សុមេធី ទីភ្នំឱរ៉ាល់ (Sumedhi TyPhnomAoral)
 
การเขียนข้อเสนอโครงการวิจัย (Research Proposal)
การเขียนข้อเสนอโครงการวิจัย (Research Proposal)การเขียนข้อเสนอโครงการวิจัย (Research Proposal)
การเขียนข้อเสนอโครงการวิจัย (Research Proposal)
Prachyanun Nilsook
 
งานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdf
งานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdfงานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdf
งานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdf
Faculty of BuddhismMahachulalongkornrajavidyalaya Roi Et Buddhist College
 
ภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนา
ภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนาภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนา
ภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนา
Faculty of BuddhismMahachulalongkornrajavidyalaya Roi Et Buddhist College
 
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf
สุเมธี​​​​ ตี่พนมโอรัล / សុមេធី ទីភ្នំឱរ៉ាល់ (Sumedhi TyPhnomAoral)
 
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf
สุเมธี​​​​ ตี่พนมโอรัล / សុមេធី ទីភ្នំឱរ៉ាល់ (Sumedhi TyPhnomAoral)
 
4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf
4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf
4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf
สุเมธี​​​​ ตี่พนมโอรัล / សុមេធី ទីភ្នំឱរ៉ាល់ (Sumedhi TyPhnomAoral)
 
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf
สุเมธี​​​​ ตี่พนมโอรัล / សុមេធី ទីភ្នំឱរ៉ាល់ (Sumedhi TyPhnomAoral)
 

Recently uploaded (10)

แนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdf
แนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdfแนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdf
แนวความเชื่อ วิธีการปฎิบัติ พระพุทธศาสนามหายาน.pdf
 
atwordfamily words with Thai translationtx
atwordfamily words with Thai translationtxatwordfamily words with Thai translationtx
atwordfamily words with Thai translationtx
 
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา สัมพันธ์ไทย ประโยค ป.ธ.3 (2500-2567).pdf
 
การเขียนข้อเสนอโครงการวิจัย (Research Proposal)
การเขียนข้อเสนอโครงการวิจัย (Research Proposal)การเขียนข้อเสนอโครงการวิจัย (Research Proposal)
การเขียนข้อเสนอโครงการวิจัย (Research Proposal)
 
งานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdf
งานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdfงานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdf
งานนำเสนอ ภาษากับการสื่อสาร เพื่อการพัฒนา.pdf
 
ภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนา
ภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนาภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนา
ภาษาอังกฤษเพื่อการปฏิบัติกรรมฐานในพระพุทธศาสนา
 
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค 1-2 (2510-2567).pdf
 
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf
1-2_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา บาลีไวยากรณ์ ประโยค 1-2 (2511-2567).pdf
 
4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf
4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf
4_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลไทยเป็นมคธ ประโยค ป.ธ.4 (2505-2567).pdf
 
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf
3_ปัญหาและเฉลยข้อสอบบาลีสนามหลวง วิชา แปลมคธเป็นไทย ประโยค ป.ธ.3 (2500-2567).pdf
 

01 sql-overview

  • 1. K.Warawut SQL Overview 1 SQL OverviewSQL Overview Suan Dusit Rajabhat University Phitsanulok CampusSuan Dusit Rajabhat University Phitsanulok Campus Mr.Warawut KhangkhanMr.Warawut Khangkhan
  • 2. K.Warawut SQL Overview 2 กลมค สงกลมค สง SQLSQL ● ค สงนย มขอมล (Data Definition Language: DDL) ● ค สงด เนนก รขอมล (Data Manipulation Language: DML) ● ค สงควบคมขอมล (Data Control Language: DCL)
  • 3. K.Warawut SQL Overview 3 ค สงด เนนก รกบขอมลค สงด เนนก รกบขอมล (Data Manipulation Language: DML)(Data Manipulation Language: DML) ● เปนกลมค สงทใชด เนนก รกบขอมลในฐ นขอมล เชน ก รเพม ลบ ปรบปรง และเรยกดขอมล เปนตน ● ค สงในกลมน%จะไมส ม รถเปลยนแปลง โครงสร งของฐ นขอมลได
  • 4. K.Warawut SQL Overview 4 ก รเพมขอมลในก รเพมขอมลใน TableTable รปแบบ INSERT INTO table-name [(col-1, ..., col-n)] VALUES (value-1, ..., value-n);
  • 5. K.Warawut SQL Overview 5 ก รแกไขขอมลในก รแกไขขอมลใน TableTable รปแบบ UPDATE table-name SET col-1 = value-1, ..., col-n = value-n [WHERE condition];
  • 6. K.Warawut SQL Overview 6 ก รลบขอมลในก รลบขอมลใน TableTable รปแบบ DELETE FROM table-name [WHERE condition];
  • 7. K.Warawut SQL Overview 7 ก รเรยกดขอมลในก รเรยกดขอมลใน TableTable รปแบบ SELECT * | [DISTINCT] col-1, col-2, ..., col-n FROM table-name [WHERE condition] [GROUP BY col-1, col-2, ..., col-n] [HAVING condition] [ORDER BY col-1, col-2, ..., col-n];
  • 8. K.Warawut SQL Overview 8 ก รเรยกดขอมลม กกวก รเรยกดขอมลม กกว 1 Table1 Table ● ตองมก รรวมขอมลจ กหล ยต ร งดวยก รใชค สง JOIN – Inner Join ไดแก Equijoin, Non-Equijoin, Cross Join และ Self Join – Outer Join ไดแก Left Outer Join, Right Outer Join และ Full Outer Join
  • 9. K.Warawut SQL Overview 9 EquijoinEquijoin ● เปนก รจบคแถวทมขอมลตรงกนของ 2 ต ร ง ค+อ มลกษณะเปนก รใชเคร+องหม ยเท กบ (=) ในก ร จบค ● รปแบบ table-name1 INNER JOIN table-name2 ON table-name1.col1 = table-name2.col2
  • 10. K.Warawut SQL Overview 10 Example EquijoinExample Equijoin SELECT Sales.SalesID, SFirstName, SLastName FORM Sales INNER JOIN Orders ON Sales.SalesID = Orders.SalesID WHERE Orders.OrderDate = '2549-10-21';
  • 11. K.Warawut SQL Overview 11 Contact usContact us Mr.Warawut KhangkhanMr.Warawut Khangkhan Social Media: http://www.facebook.com/awarawut http://twitter.com/awarawut Web Site: http://awarawut.blogspot.com E-Mail: awarawut@hotmail.com Mobile: 083-0698-410