Before we go, first we will create
a table and you assume that the table already exists. Because that is how the
following statement executes that means it will look for the existence of both
the table involved in the query. Below is the table create statement:
CREATE TABLE DisType
(
discounttype varchar(40),
discount decimal(4, 2) NOT NULL
);
We just created a Distype
table with two columns. And we are going to insert data into this table from
the existing Discounts table in the Pubs database.
Now look at the below insert
statement:
Insert into DisType(Discounttype,discount)
Select DiscountType, Discount from Discounts;

Join the conversation! Your thoughts help the community grow.