Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
modul:m290:learningunits:lu04:theorie:a_syntax [2024/08/30 10:13] vdemirmodul:m290:learningunits:lu04:theorie:a_syntax [2024/10/17 12:33] (aktuell) vdemir
Zeile 1: Zeile 1:
-====== LU04a - Syntax of DML ======+====== LU06a - Syntax of a DQL-Select statement ======
  
-===== Introduction ===== +As we know, **SQL** stands for **S**tructured **Q**uery **L**anguage. Consequently, It should come as no surprise that SQL is indeed consistently structured. The figure below shows the  structure of a exhaustive SQL statement.
-As we know, **SQL** stands for **S**tructured **Q**uery **L**anguage. Consequently, It should come as no surprise that SQL is indeed consistently structured. +
  
-===== NOTE ===== +{{:modul:m290:learningunits:lu04:theorie:sql-syntax.png?600|}} 
-Please note that the use og CAPITAL LETTERS for SQL commands and tabs can make it easier for you to maintain your program code. + 
 +===== NOTES  ===== 
 +  * The content of this chapter is based on the  [[https://www.w3schools.com/sql/sql_syntax.asp|W3School-SQL-tutorial]]. 
 +  * Please note that the use og CAPITAL LETTERS for SQL commands and tabs can make it easier for you to maintain your program code.  
 +  * Make sure, that every complete sql statement is finished by a semicolon (;).
  
 ===== The Syntax of DML commands ===== ===== The Syntax of DML commands =====
 Every SQL query is composed by three main commands: Every SQL query is composed by three main commands:
-  * **SELECT** column1column2, ... + 
 +  * **SELECT** myColumn1myColumn2, ... [or * for all columns]
   * **FROM** myTable   * **FROM** myTable
   * **WHERE** myCondition.    * **WHERE** myCondition. 
 +  * **ORDER BY** myColumn2 **ASC|DESC**;
  
-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.+With **SELECT** we specify which columns we want to retrieve, with **FROM** we specify the TABLE from which the columns originatewith **WHERE** we determine the condition under which the data records are selected, and finally, with **ORDER BY** +  **[ASC | DESC]** we define the order in which the result set is to be displayed on the screen
  
-===== Example ===== +===== Basic 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.+Let'take a table **Customers** as shown in the figure below.  
 + 
 +{{:modul:m290:learningunits:lu04:theorie:screenshot_2024-08-30_095010.png?700|}} 
 + 
 +To retrieve all the information, which are stored in this table, our SQL command would be like follows
  
    SELECT *     SELECT * 
Zeile 26: Zeile 35:
    FROM Customers;    FROM Customers;
        
- The result would be as to be seen below.+The result set would include the entire contents of the table, since we we have not defined any preconditions or filters 
 + 
 + 
 + 
 + 
 + 
  
-{{:modul:m290:learningunits:lu04:theorie:screenshot_2024-08-30_095010.png?600|}} 
  
  
 ===== Vocabulary ===== ===== Vocabulary =====
 ^ English ^ German ^ ^ English ^ German ^
 +| precondition | Vorbedingung |
 +| exhaustive  | erschöpfend, vollständig |
 +| clause | Abschnitt | 
 +| to determine | bestimmen |
 +| to fetch | abrufen, holen | 
 | be composed by | besteht aus |  | be composed by | besteht aus | 
 | notation | Schreibweise | | notation | Schreibweise |
- 
  
 ---- ----
 [[https://creativecommons.org/licenses/by-nc-sa/4.0/|{{https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png}}]] Volkan Demir [[https://creativecommons.org/licenses/by-nc-sa/4.0/|{{https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png}}]] Volkan Demir
  
  • modul/m290/learningunits/lu04/theorie/a_syntax.1725005614.txt.gz
  • Zuletzt geändert: 2024/08/30 10:13
  • von vdemir