"if you encounter any errors in SAP, send me a screenshot at pramod@learntosap.com, and I will help you resolve the issue."

SQL INSERT INTO

SQL TUTORIALS-

SQL INSERT INTO Statement

Introduction-


Trulli Trulli

-πŸ”SQL INSERT INTO – Explanation with Example (For learntosap.com)

SQL INSERT INTO statement is used to insert new records into a table...

βœ… 1-If specifies the table name and the values to be inserted into its columns. You can either insert values into all columns or specify certain columns only.basic syntax is Follow:-


INSERT INTO table_name
VALUES (value1, value2, value3, ...);

βœ… 2-If inserting into all columns, don’t need to write the column names in the INSERT INTO statement if you're providing values for all the columns in the exact order they are defined in the table..basic syntax is Follow:-




INSERT INTO table_name VALUES (value1, value2);

Emoji Examples in HTML

πŸ”Έ Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 9000
3 RAJ SALES 5000

βœ… Example 1: Insert full values in all columns:-


INSERT INTO Employees (ID, Name, Department, Salary)
VALUES (4, 'MAYA', 'HR', 11000);

Row inserted β†’ 4 | MAYA | HR | 11000

βœ…Result Show :-

Emoji Examples in HTML

πŸ”Έ Example Table: Employees


ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 9000
3 RAJ SALES 5000
4 MAYA HR 11000

βœ… Example 2: Insert (ONE MORE) another record:-

βœ…SELECT Query :-


INSERT INTO Employees (ID, Name, Department, Salary)
VALUES (5, 'NILESH', 'HR', 7000);

Row inserted β†’ 5 | NILESH | HR | 7000

βœ…Result Show :-

Emoji Examples in HTML

πŸ”Έ Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 9000
3 RAJ SALES 5000
4 MAYA HR 11000
5 NILESH HR 7000

Example 3: Insert without column name (column order must match this table):-

βœ…SELECT Query :-


INSERT INTO Employees
VALUES (6, 'PRAMOD', 'IT', 12000);

Row inserted β†’ 6 | PRAMOD | IT | 12000

βœ…Result Show :-

Emoji Examples in HTML

πŸ”Έ Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 9000
3 RAJ SALES 5000
4 MAYA HR 11000
5 NILESH HR 7000
6 PRAMOD IT 12000

May Be Like Important Link-

-Chart Of Account-OB13

-Define Plant-OX1

-Chart Of Account-OB13

-Define Financial Statement