Skip to main content
SNP-2025-0012
Home / Code Snippets / SNP-2025-0012
SNP-2025-0012  ·  CODE SNIPPET

How to insert data into your Table, the correct way

SQL · Published: 2024-01-18 · debmedia
01
Problem Statement & Scenario
The Problem

Let's start

You can now start adding data into it with the INSERT INTO command:

  1. Inserting a single record:
INSERT INTO people VALUES (20, 'Tony');
  1. Inserting multiple records:
INSERT INTO people VALUES (57, 'Joe'), (8, 'Ruby');
  1. Inserting data into specific columns:
INSERT INTO people (name) VALUES ('Harry');

To execute these queries using TablePlus SQL editor, follow these steps:

  1. Open TablePlus and connect to your database.
  2. In the SQL editor, paste one of the provided queries.
  3. Select the query with your mouse.
  4. Click on "Run Current" to execute the query.

After executing the queries, you can refresh the database view, click on the "people" table, and inspect its content. You'll see the inserted data reflecting the changes made.

Conclusion

These INSERT INTO commands allow you to populate your database tables with the necessary data, providing a foundation for meaningful interactions and queries. Feel free to experiment with different values and combinations to familiarize yourself with the process of inserting data into a SQL database.

1-on-1 Technical Mentorship

Want to master snippets like this?

Debasis Bhattacharjee offers direct mentorship sessions for developers looking to level up their code quality, architecture decisions, and production engineering skills. Two decades of real-world experience — no theory, just craft.