Adding data to a table
When adding data to a database through an application, you will usually add one record at a time, although you may string several additions together in a single script. The data can come from a system user, sensors on a production line, be scraped from a webpage, another computer, or any other method where it is possible to extract data for recording, and the computer applications behind all of these possible data entry sources will record it in a similar way.
You can add a record in the table using the following command:
INSERT INTO [TableName]([field1],[field2],…,[fieldn]) VALUES (Value1,Value2,…,Valuen)
It is also possible to insert data from another table into the current target. These types of queries will use a SELECT
statement and work as shown here:
INSERT INTO [TableName]([field1],[field2],…,[fieldn]) SELECT [field1,field2,…,fieldn] FROM [tablename]
In the next exercise, you will add a record to a database...