INSERT



SQL Server INSERT Statement

SQL INSERT Statement is used to add new row/record to the database table.


Syntax of INSERT Query
--example
INSERT INTO TABLE_NAME (column1, column2, column3,...columnN)  
VALUES (value1, value2, value3,...valueN);


EXAMPLE
Person Table Structure

Column NameData Type
IDINT
NAMEVARCHAR(100)
AGEINT
ADDRESSVARCHAR(249)
SALARYDECIMAL(8,2)

The following is the INSERT statement used to create a new record in Person table with specifying column names in the INSERT Query.

INSERT INTO 
       Person ( ID, NAME, AGE, ADDRESS, SALARY)
VALUES 
       ( 1, 'Keerthana', 24, 'Hyderabad', 10,000.00);


The following is the INSERT statement used to create a new record in Person table with out specifying column names in the INSERT Query.

INSERT INTO 
      Person
VALUES 
      ( 2, 'Bharath', 25, 'Hyderabad', 10,000.00 );

All the above statements would produce the following records in the persons data table as shown below.

+----+----------+-----+-----------+----------+
| ID | NAME     | AGE | ADDRESS   | SALARY   |
+----+----------+-----+-----------+----------+
|  1 | Keerthana|  24 | Hyderabad | 10,000.00|
|  2 | Bharath  |  25 | Hyderabad | 10,000.00|
+----+----------+-----+-----------+----------+


Connection String

SQL Server Connection String Formats

posted on 2019-08-27 05:53:53 - SQL Server Tutorials


UNION

union in SQL server

posted on 2019-08-09 23:05:33 - SQL Server Tutorials


System Functions

System Functions in SQL Server

posted on 2019-08-09 06:14:33 - SQL Server Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials