Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Inserting Rows into a Table | Populating a Database
Introduction to SQL
course content

Conteúdo do Curso

Introduction to SQL

Introduction to SQL

1. Getting Started
3. Sorting Data
4. Populating a Database
5. Updating & Deleting Data

book
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:

sql

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:

sql

Demonstration:

Tip:

There is a shorter syntax for inserting rows into a table:

sql

For example:

sql

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.

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 4. Capítulo 3
Sentimos muito que algo saiu errado. O que aconteceu?
some-alt