Does every SQL statement follow this structure?


#1

Question

In the context of this exercise, does every SQL statement follow this structure?

Answer

In general, SQL statements will usually follow a similar structure as the given example SQL statement, but depending on what you are trying to do, they can also look very different.

The following are some examples of different kinds of SQL statements you might use, which will be covered throughout this lesson.

This statement selects all rows from a table.

SELECT * FROM table;

This statement will create a new table.

CREATE TABLE students (
  column_1 data_type,
  column_2 data_type
);

This statement will update a row in a table.

UPDATE table
SET column_1 = new_value
WHERE id = 3;