Dies ist eine alte Version des Dokuments!
LU04a - Syntax of DML
Introduction
As we know, SQL stands for Structured Query Language. Consequently, It should come as no surprise that SQL is indeed consistently structured.
NOTE
Please note that the use og CAPITAL LETTERS for SQL commands and tabs can make it easier for you to maintain your program code.
The Syntax of DML commands
Every SQL query is composed by three main commands:
- SELECT column1, column2, …
- FROM myTable
- WHERE myCondition.
With SELECT you specify which columns you want to have output; with FROM you specify the TABLE from which the columns originate; and with WHERE you specify the condition under which the data records are selected. Where does not have to occur if there is no condition.
Example
Let us take a table Customers which canwith in below picture. To get all information, which are stored in this table, our SQL command would be like below. Please not, that due to not prerequisits the WHERE clause is in that case not necessary.
SELECT * FROM Customers;
or as a more detailed notation
SELECT CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country FROM Customers;
The result would be as to be seen below.

