-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatements
More file actions
21 lines (15 loc) · 899 Bytes
/
Statements
File metadata and controls
21 lines (15 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
The code below is a SQL statement. A statement is text that the database recognizes as a valid command. Statements always end in a semicolon ;.
CREATE TABLE table_name (
column_1 data_type,
column_2 data_type,
column_3 data_type
);
Let’s break down the components of a statement:
CREATE TABLE is a clause. Clauses perform specific tasks in SQL. By convention, clauses are written in capital letters. Clauses can also be referred to as commands.
table_name refers to the name of the table that the command is applied to.
(column_1 data_type, column_2 data_type, column_3 data_type) is a parameter. A parameter is a list of columns, data types, or values that are passed to a clause as an argument.
Here, the parameter is a list of column names and the associated data type.
EXAMPLE:
SELECT * FROM celebs;
Select & FROM are the clauses
Command is being applied to the celebs table