Skip to content · ⁨Pular para o conteúdo⁩
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:

Português

Dois tipos de comando SQL

SQL tem duas metades:

  • DDL (Data Definition Language) altera a estrutura — as próprias tabelas.
  • DML (Data Manipulation Language) lida com os dados dentro das tabelas — lendo-os com SELECT, e adicionando, alterando ou removendo-os com INSERT/UPDATE/DELETE. Tudo até agora (SELECT) é DML.

CREATE TABLE é o principal comando DDL. Ele lista cada coluna com um tipo de dado e marca a chave primária:

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

CREATE TABLE define as colunas e cria uma tabela vazia

Handout · ⁨Material de apoio⁩

Log in or create account · ⁨Entrar ou criar conta⁩

IGCSE, A-Level & AP