Skip to content · ⁨דלג לתוכן⁩
English

Two kinds of SQL command

SQL has two halves:

  • DDL (Data Definition Language) changes the structure — the tables themselves.
  • DML (Data Manipulation Language) works with the data inside the tables — reading it with SELECT, and adding, changing, or removing it with INSERT/UPDATE/DELETE. Everything so far (SELECT) is DML.

CREATE TABLE is the main DDL command. It lists each column with a data type and marks the primary key:

עברית

שני סוגי פקודות SQL

ל-SQL יש שני חצאים:

  • DDL (שפת הגדרת נתונים) משנה את המבנה – את הטבלאות עצמן.
  • DML (שפת עיבוד נתונים) עובדת עם הנתונים בתוך הטבלאות – קורא אותם עם SELECT, ומוסיף, משנה או מוסר אותם עם INSERT/UPDATE/DELETE. הכל עד כה (SELECT) הוא DML.

CREATE TABLE היא הפקודה המרכזית ב-DDL. היא מפרטת כל עמודה עם סוג נתונים ומסמנת אתמפתח ראשי:

CREATE TABLE customer (
  id   INTEGER PRIMARY KEY,
  name VARCHAR(20),
  city VARCHAR(15)
);

CREATE TABLE מגדיר את העמודות ויוצר טבלה ריקה

Handout · ⁨חומר עזר⁩

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP