|SQL Order By|
|SQL Select Top|
|SQL Select Distinct|
|SQL Min, Max|
|SQL Count, Sum, Avg|
|SQL And, Or, Not|
|SQL Is Null|
|SQL Group By|
|SQL Left Join|
|SQL Right Join|
|SQL Full Join|
|SQL Self Join|
|SQL Any, All|
|SQL Select Into|
|SQL Insert Into|
SQL was designed to be entered on a console and results would display back to a screen.
Today, SQL is mostly used by programmers who use SQL inside their language to build applications that access data in a database.
Four fundamental operations that apply to any database are:
Collectively these are referred to as CRUD (Create, Read, Update, Delete).
The general form for each of these 4 operations in SQL is presented next.
SELECT column-names FROM table-name WHERE condition ORDER BY sort-order
SELECT FirstName, LastName, City, Country FROM Customer WHERE City = 'Paris' ORDER BY LastName
INSERT table-name (column-names) VALUES (column-values)
INSERT Supplier (Name, ContactName, City, Country) VALUES ('Oxford Trading', 'Ian Smith', 'Oxford', 'UK')
UPDATE table-name SET column-name = column-value WHERE condition
UPDATE OrderItem SET Quantity = 2 WHERE Id = 388
DELETE table-name WHERE condition
DELETE Customer WHERE Email = 'firstname.lastname@example.org'