SQL – Insert into

Spread the love

SQL – INSERT –two types of inserts operations can be done for inserting the records into the table

INSERT INTO TABLE (column1, column2) VALUES (value1, value2);
INSERT INTO TABLE (column1 , column2) select column1 , column2 from table

Concept

Insert Values in Table

 

 

Summary Table

S_NOPRODUCTTOTAL_QTY_SOLD
1PUMA16
2REEBOK38

 

RawData Table

S_NOPRODUCTTOTAL_QTY_SOLDMONTH
1ADIDAS5JAN
2PROLINE10MAY
3NIKE NEO38FEB

 

INSERT INTO SUMMARY
( S_NO, PRODUCT , TOTAL_QTY_SOLD )
VALUES
( 3 , ‘NIKE’ ,60 )
Result

S_NOBRANDQTY
1PUMA16
2REEBOK38
3NIKE60

 

 

INSERT INTO SUMMARY ( S_NO, PRODUCT , TOTAL_QTY_SOLD )
SELECT S_NO , BRAND , QTY
FROM BRAND WHERE BRAND = ‘NIKE NEO’

Result

S_NOBRANDQTY
1PUMA16
2REEBOK38
3NIKE60
3NIKE NEO38

insert into values search keyword

insert values into table sql search keyword
insert values into table search keyword
insert values into a table search keyword
insert records into a table search keyword
insert into command sql search keyword
select insert into value by sql query search keyword
sql query find insert into value from table search keyword
sql insert values into table search keyword
sql insert values into a table search keyword
sql insert records into a table search keyword
sql insert data into a table search keyword
sql insert data into table search keyword
sql insert data into existing table search keyword