Inserting Data for Specific Columns

look at the below insert statement. In the below statement after the table name discounts column names separated by comma is specified within the parenthesis. Also in the values list the values in the same order of the column list is specified. If the value is a text string, a single quote is used to enclose the string.

 

Use the Pubs database.

 

--Insert data to a specific column

insert into discounts(discounttype, discount)

values('Seasonal Discount', 11.15);

Select * from Discounts;

 

Below is the result of executing the Query:

 

Pic03.JPG