How to use SQL Insert statement.

Web developer can use the SQL Insert statement to add a new record to a table with the information he/she specifies:

INSERT INTO [table] ([column_list]) VALUES ([value_list])

Web developer can provide the information in any order he/she wants, as long as he/she makes sure the list of column names and the list of values correspond exactly:

INSERT INTO Clients (cli_id,cli_finame, cli_lname)
VALUES (‘667-83-6634’, ‘Peter’, ‘Smith’)

This example leaves out some information, such as the city and address, in order to provide a simple example. However, it provides the minimum information that’s required to create a new record in the Clients table.

Database tables often have requirements that can prevent user from adding a record unless he/she fills in all the fields with valid information. Alternatively, some fields may be configured to use a default value if left blank.
One feature the Clients table doesn’t use is an automatically incrementing identity field. This feature, which is supported in most relational database products, assigns a unique value to a specified field when user performs an insert operation. When he/she inserts a record into a table that has a unique incrementing ID, he/she shouldn’t specify a value for the ID, because the database will choose it one automatically.