Wat is SQL?


HTML

SQL staan vir S tructured Query T anguage

SQL is 'n standaardtaal vir toegang tot databasisse

SQL is sedert 1987 'n internasionale standaard (ISO).


SQL-stellings

Om toegang tot 'n databasis te verkry, gebruik jy SQL-stellings.

Die volgende SQL-stelling kies alle rekords in 'n databasistabel genaamd "Klante":

Voorbeeld

SELECT * FROM Customers;

Databasistabelle

'n Databasis bevat meestal een of meer tabelle.

Elke tabel word geïdentifiseer deur 'n naam soos "Klante" of "Bestellings".

Hieronder is 'n keuse uit 'n "Klante"-tabel:

ID CustomerName ContactName Address City PostalCode Country
1

Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo Emparedados y helados Ana Trujillo Avda. de la Constitución 2222 México D.F. 05021 Mexico
3 Antonio Moreno Taquería Antonio Moreno Mataderos 2312 México D.F. 05023 Mexico
4

Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina Berglund Berguvsvägen 8 Luleå S-958 22 Sweden

Die tabel hierbo bevat vyf rekords (een vir elke kliënt) en sewe kolomme:

  1. Kliënt-ID (ID)
  2. Kliënt naam
  3. Kontak naam
  4. Adres
  5. Stad
  6. Poskode
  7. Land

Die belangrikste SQL-stellings:

  • SELECT - onttrek data uit 'n databasis
  • UPDATE - werk data in 'n databasis op
  • DELETE - vee data uit 'n databasis uit
  • INSERT INTO - voeg nuwe data in 'n databasis in
  • SKEP DATABASIS - skep 'n nuwe databasis
  • VERANDER DATABASIS - wysig 'n databasis
  • SKEP TABEL - skep 'n nuwe tabel
  • VERANDER TABEL - wysig 'n tabel
  • LAAT TABEL - vee 'n tabel uit
  • CREATE INDEX - skep 'n indeks (soeksleutel)
  • DROP INDEX - vee 'n indeks uit

SQL sleutelwoorde is NIE hooflettergevoelig nie: kies is dieselfde as SELECT


Volledige SQL-tutoriaal

Dit was 'n kort inleiding tot SQL.

Vir 'n volledige SQL-tutoriaal gaan na W3Schools SQL-tutoriaal .