SlideShare a Scribd company logo
1 of 1
Download to read offline
SQL CHEET SHEET
SQL SELECT STATEMENTS
SELECT * FROM t
SELECT c1,c2 FROM t
SELECT c1,c2 FROM t
WHERE conditions
SELECT c1,c2 FROM t
WHERE conditions
ORDER BY c1 ASC,c2 DESC
SELECT DISTICT c1,c2
FROM t
SELECT c1, aggregate(c2 * c3)
FROM t
GROUP BY c1
SELECT c1, aggregate(c2 * c3)
FROM t
GROUP BY c1
HAVING c1 > v1
SQL UPDATE DATABASE
INSERT INTO t (c1,c2…)
VALUES (v1,v2…)
INSERT INTO t1 (c1,c2…)
SELECT c1,c2… FROM t2
WHERE conditions
UPDATE t
SET c1 = v1, c2 = v2,…
WHERE conditions
DELETE FROM t
WHERE conditions
TRUNCATE TABLE t
SQL OPERATORS
SELECT * FROM t
WHERE c1 [NOT] BETWEEN v1
AND v2
SELECT * FROM t
WHERE c1 [NOT ] IN (v1,v2,…)
SELECT* FROM t
WHERE c1 > v1 AND c1 < v2
SELECT * FROM t
WHERE c1 < v1 OR c1 > v2
SELECT * FROM t
WHERE c1 = v1
SELECT * FROM t
WHERE c1 <> v1
SQL TABLE STATEMENTS
CREATE TABLE t(
c1 dt1(l1),
c2 dt2(l2),
...
)
DROP TABLE t
ALTER TABLE t
ADD COLUMN c dt(l)
ALTER TABLE t
DROP COLUMN c
SQL VIEW STATEMENTS
CREATE UNIQUE
INDEX idx ON t(c1,c2..)
DROP INDEX t.idx
SQL JOIN STATEMENTS
SELECT * FROM t1
INNER JOIN t2 ON conditions
SELECT * FROM t
WHERE c1 [NOT ] IN (v1,v2,…)
SELECT * FROM t1
INNER JOIN t2 ON conditions
WHERE conditions
SELECT *
FROM t1, t2
WHERE conditions
SELECT * FROM t1
LEFT JOIN t2 ON conditions
SELECT * FROM t1
RIGHT JOIN t2 ON conditions
SELECT * FROM t1
FULL OUTER JOIN t2 ON conditions
SELECT * FROM t1 AS at1
INNER JOIN t2 AS at2 ON at1.c1 =
at2.c2
SQL VIEW STATEMENTS
CREATE VIEW vw
AS
SELECT c1,c2
FROM t
ALTER VIEW vw
AS
SELECT c1,c2
FROM t
DROP VIEW vw
t:table name, c: column name,vw: view name, v: value,dt: data type,l: data type length, at: table alias,aggregate: aggreate
function,idx: index name
Copyright by SQLDatabaseTutorial.com 2008

More Related Content

What's hot (20)

Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Session07 recursion
Session07 recursionSession07 recursion
Session07 recursion
 
Ppt Prog Fox
Ppt Prog FoxPpt Prog Fox
Ppt Prog Fox
 
Ppt Prog Fox
Ppt Prog FoxPpt Prog Fox
Ppt Prog Fox
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Gambas
Gambas Gambas
Gambas
 
Stack prgs
Stack prgsStack prgs
Stack prgs
 
El nuevo objeto para internacionalización y localización Intl
El nuevo objeto para internacionalización y localización IntlEl nuevo objeto para internacionalización y localización Intl
El nuevo objeto para internacionalización y localización Intl
 
Data structure circular list
Data structure circular listData structure circular list
Data structure circular list
 
C程序设计语言(第2版·新版)
C程序设计语言(第2版·新版)C程序设计语言(第2版·新版)
C程序设计语言(第2版·新版)
 
การสังเคราะห์ผลึกไททาเนียมไดออกไซด์
การสังเคราะห์ผลึกไททาเนียมไดออกไซด์การสังเคราะห์ผลึกไททาเนียมไดออกไซด์
การสังเคราะห์ผลึกไททาเนียมไดออกไซด์
 
week-10x
week-10xweek-10x
week-10x
 
week-18x
week-18xweek-18x
week-18x
 
week-2x
week-2xweek-2x
week-2x
 
C++
C++C++
C++
 
week-1x
week-1xweek-1x
week-1x
 
เขียนโปรแกรมภาษา C: คำสั่ง switch
เขียนโปรแกรมภาษา C: คำสั่ง switchเขียนโปรแกรมภาษา C: คำสั่ง switch
เขียนโปรแกรมภาษา C: คำสั่ง switch
 

Similar to Sqlcheetsheet

Using Lateral derived table in Informix database
Using Lateral derived table in Informix databaseUsing Lateral derived table in Informix database
Using Lateral derived table in Informix databaseAjay Gupte
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries Prabu Cse
 
12c Mini Lesson - Better Defaults
12c Mini Lesson - Better Defaults12c Mini Lesson - Better Defaults
12c Mini Lesson - Better DefaultsConnor McDonald
 
Left outer join step by step
Left outer join step by stepLeft outer join step by step
Left outer join step by stepAndrea Salzano
 
12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible Columns12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible ColumnsConnor McDonald
 
"Making tomorrow's code look like today's", Adam Ralph
"Making tomorrow's code look like today's", Adam Ralph"Making tomorrow's code look like today's", Adam Ralph
"Making tomorrow's code look like today's", Adam RalphFwdays
 
R-Data table Cheat Sheet
R-Data table Cheat SheetR-Data table Cheat Sheet
R-Data table Cheat SheetDr. Volkan OBAN
 
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB plc
 
SQL Quick Reference Card
SQL Quick Reference CardSQL Quick Reference Card
SQL Quick Reference CardTechcanvass
 

Similar to Sqlcheetsheet (15)

SQL-cheat-sheet.pdf
SQL-cheat-sheet.pdfSQL-cheat-sheet.pdf
SQL-cheat-sheet.pdf
 
Sql cheat sheet
Sql cheat sheetSql cheat sheet
Sql cheat sheet
 
Using Lateral derived table in Informix database
Using Lateral derived table in Informix databaseUsing Lateral derived table in Informix database
Using Lateral derived table in Informix database
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries
 
Babitha2.mysql
Babitha2.mysqlBabitha2.mysql
Babitha2.mysql
 
Babitha2 Mysql
Babitha2 MysqlBabitha2 Mysql
Babitha2 Mysql
 
12c Mini Lesson - Better Defaults
12c Mini Lesson - Better Defaults12c Mini Lesson - Better Defaults
12c Mini Lesson - Better Defaults
 
Left outer join step by step
Left outer join step by stepLeft outer join step by step
Left outer join step by step
 
12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible Columns12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible Columns
 
"Making tomorrow's code look like today's", Adam Ralph
"Making tomorrow's code look like today's", Adam Ralph"Making tomorrow's code look like today's", Adam Ralph
"Making tomorrow's code look like today's", Adam Ralph
 
R-Data table Cheat Sheet
R-Data table Cheat SheetR-Data table Cheat Sheet
R-Data table Cheat Sheet
 
To excel or not?
To excel or not?To excel or not?
To excel or not?
 
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
 
Sqlite
SqliteSqlite
Sqlite
 
SQL Quick Reference Card
SQL Quick Reference CardSQL Quick Reference Card
SQL Quick Reference Card
 

More from Nishant Upadhyay

More from Nishant Upadhyay (15)

Multivariate calculus
Multivariate calculusMultivariate calculus
Multivariate calculus
 
Multivariate calculus
Multivariate calculusMultivariate calculus
Multivariate calculus
 
Matrices1
Matrices1Matrices1
Matrices1
 
Vectors2
Vectors2Vectors2
Vectors2
 
Mathematics for machine learning calculus formulasheet
Mathematics for machine learning calculus formulasheetMathematics for machine learning calculus formulasheet
Mathematics for machine learning calculus formulasheet
 
Pandas pythonfordatascience
Pandas pythonfordatasciencePandas pythonfordatascience
Pandas pythonfordatascience
 
Numpy python cheat_sheet
Numpy python cheat_sheetNumpy python cheat_sheet
Numpy python cheat_sheet
 
Maths4ml linearalgebra-formula
Maths4ml linearalgebra-formulaMaths4ml linearalgebra-formula
Maths4ml linearalgebra-formula
 
Sql cheat-sheet
Sql cheat-sheetSql cheat-sheet
Sql cheat-sheet
 
My sql installationguide_windows
My sql installationguide_windowsMy sql installationguide_windows
My sql installationguide_windows
 
Company handout
Company handoutCompany handout
Company handout
 
Python bokeh cheat_sheet
Python bokeh cheat_sheet Python bokeh cheat_sheet
Python bokeh cheat_sheet
 
Foliumcheatsheet
FoliumcheatsheetFoliumcheatsheet
Foliumcheatsheet
 
Python matplotlib cheat_sheet
Python matplotlib cheat_sheetPython matplotlib cheat_sheet
Python matplotlib cheat_sheet
 
Python seaborn cheat_sheet
Python seaborn cheat_sheetPython seaborn cheat_sheet
Python seaborn cheat_sheet
 

Recently uploaded

Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxTanveerAhmed817946
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknowmakika9823
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 

Recently uploaded (20)

Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptx
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 

Sqlcheetsheet

  • 1. SQL CHEET SHEET SQL SELECT STATEMENTS SELECT * FROM t SELECT c1,c2 FROM t SELECT c1,c2 FROM t WHERE conditions SELECT c1,c2 FROM t WHERE conditions ORDER BY c1 ASC,c2 DESC SELECT DISTICT c1,c2 FROM t SELECT c1, aggregate(c2 * c3) FROM t GROUP BY c1 SELECT c1, aggregate(c2 * c3) FROM t GROUP BY c1 HAVING c1 > v1 SQL UPDATE DATABASE INSERT INTO t (c1,c2…) VALUES (v1,v2…) INSERT INTO t1 (c1,c2…) SELECT c1,c2… FROM t2 WHERE conditions UPDATE t SET c1 = v1, c2 = v2,… WHERE conditions DELETE FROM t WHERE conditions TRUNCATE TABLE t SQL OPERATORS SELECT * FROM t WHERE c1 [NOT] BETWEEN v1 AND v2 SELECT * FROM t WHERE c1 [NOT ] IN (v1,v2,…) SELECT* FROM t WHERE c1 > v1 AND c1 < v2 SELECT * FROM t WHERE c1 < v1 OR c1 > v2 SELECT * FROM t WHERE c1 = v1 SELECT * FROM t WHERE c1 <> v1 SQL TABLE STATEMENTS CREATE TABLE t( c1 dt1(l1), c2 dt2(l2), ... ) DROP TABLE t ALTER TABLE t ADD COLUMN c dt(l) ALTER TABLE t DROP COLUMN c SQL VIEW STATEMENTS CREATE UNIQUE INDEX idx ON t(c1,c2..) DROP INDEX t.idx SQL JOIN STATEMENTS SELECT * FROM t1 INNER JOIN t2 ON conditions SELECT * FROM t WHERE c1 [NOT ] IN (v1,v2,…) SELECT * FROM t1 INNER JOIN t2 ON conditions WHERE conditions SELECT * FROM t1, t2 WHERE conditions SELECT * FROM t1 LEFT JOIN t2 ON conditions SELECT * FROM t1 RIGHT JOIN t2 ON conditions SELECT * FROM t1 FULL OUTER JOIN t2 ON conditions SELECT * FROM t1 AS at1 INNER JOIN t2 AS at2 ON at1.c1 = at2.c2 SQL VIEW STATEMENTS CREATE VIEW vw AS SELECT c1,c2 FROM t ALTER VIEW vw AS SELECT c1,c2 FROM t DROP VIEW vw t:table name, c: column name,vw: view name, v: value,dt: data type,l: data type length, at: table alias,aggregate: aggreate function,idx: index name Copyright by SQLDatabaseTutorial.com 2008