Conteúdo do Curso
Introduction to SQL
Introduction to SQL
Inserting Rows into a Table
After creating a table, we can insert rows into it using an INSERT
statement.
Following is the general syntax of an INSERT
statement:
In the above syntax, the table_name
refers to the name of the table in which we want to insert a row.
The sequence of values (value1, value2, value3, ...)
needs to be in the same order as the sequence of the columns that are specified at (column1, column2, column3, ...)
.
For example:
Demonstration:
Tip:
There is a shorter syntax for inserting rows into a table:
For example:
In this case, the order in which the values are stated should be the same as the default order of the columns.
The difference between the use cases of the two syntaxes we explored will become more apparent in the later chapters.
Obrigado pelo seu feedback!