Hi guys, in this blog post we will see how to insert data into SQL table. This blog post is for SQL beginners. Let's see it practically.
SQL insert statement is used to insert new row in SQL table.
Syntax for SQL Insert Query:-
INSERT INTO [TableName]
(columnName1
,columnName2
,columnName3
,columnName4)
VALUES
(columnValue1
,columnValue2
,columnValue3
,columnValue4)
GO
For e.g. We have table tblEmployee. We want to insert data into following table.
SQL Insert Query:-
INSERT INTO tblEmployee
(EmployeeFirstName
,EmployeeLastName
,CreatedDate
,ModifiedDate)
VALUES
('Sam'
,'Sharma'
,CURRENT_TIMESTAMP
,CURRENT_TIMESTAMP)
GO
After executing above query data in table will look like:-
For retrieving data from table, you can use following select query:-
SELECT * FROM tblEmployee
No comments:
Post a Comment