I'll provide an example of how you can insert some data into the "employees" table we created earlier. Remember that the data you insert should match the data types specified for each column in the table.
Assuming we have the following data to insert:
Employee ID: 101 First Name: John Last Name: Doe Hire Date: 2023-01-15 Salary: $50000.00
Employee ID: 102 First Name: Jane Last Name: Smith Hire Date: 2023-03-20 Salary: $60000.00
You can use the following SQL INSERT statements to add this data to the "employees" table:
sqlINSERT INTO employees (employee_id, first_name, last_name, hire_date, salary)
VALUES (101, 'John', 'Doe', '2023-01-15', 50000.00);
INSERT INTO employees (employee_id, first_name, last_name, hire_date, salary)
VALUES (102, 'Jane', 'Smith', '2023-03-20', 60000.00);
Make sure to execute these SQL statements one by one in the order provided. The first INSERT statement will insert the data for the employee with ID 101, and the second INSERT statement will insert the data for the employee with ID 102.
After executing these INSERT statements, your "employees" table will have two rows with the provided data. If you query the table, you should see the inserted data as follows:
diff+-------------+------------+-----------+------------+----------+
| employee_id | first_name | last_name | hire_date | salary |
+-------------+------------+-----------+------------+----------+
| 101 | John | Doe | 2023-01-15 | 50000.00 |
| 102 | Jane | Smith | 2023-03-20 | 60000.00 |
+-------------+------------+-----------+------------+----------+
Please note that the actual data may differ based on the specific values you used in the INSERT statements. Also, ensure that the primary key (employee_id) is unique for each employee to avoid data conflicts.
Comments
Post a Comment