Inserting Data in SQL

 Inserting Data in SQL


After creating tables, we need to populate them with data. We can use the INSERT INTO statement to add data to our tables. Here's an example:

sql


INSERT INTO employees (id, name, age, department)

VALUES (1, 'John Doe', 30, 'Sales'),

       (2, 'Jane Smith', 25, 'Marketing'),

       (3, 'Bob Johnson', 40, 'Engineering');

In this example, we're inserting three rows into the "employees" table. Each row represents an employee with an id, name, age, and department.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...