DbSchema Database Designer

DbSchema | MySQL - How to Insert Data?

Publish on DbSchema Blog >>>

In MySQL, tables are used to store data in a structured format. Once you have created a table, you can insert data into it. In this article, we will learn how to insert data into a table in MySQL.

Prerequisites

Before we begin, you should have the following:

  • A database with a table in which to insert data
  • Administrative privileges to insert data into the table

Inserting Data into a Table

To insert data into a table in MySQL, follow these steps:

  1. Open the MySQL client.
  2. Log in to the MySQL server using the following command:
mysql -u username -p

Replace __username` with your MySQL username. You will be prompted to enter your password.

  1. Once you are logged in, select the database in which the table is located:
USE dbname;

Replace __dbname` with the name of the database that contains the table.

  1. Insert data into the table using the following command:
INSERT INTO tablename (column1, column2, ..., columnN) VALUES (value1, value2, ..., valueN);

Replace __tablename with the name of the table into which you want to insert data. Replace __column1, __column2, and so on with the names of the columns in the table. Replace __value1, __value2`, and so on with the values you want to insert into the columns.

  1. Verify that the data has been inserted into the table by using the following command:
SELECT * FROM tablename;

This will display all the data in the selected table.

Insert Data and Visually Manage MySql using DbSchema

DbSchema is a MySQL client and visual designer. DbSchema has a free Community Edition, which can be downloaded here.

Insert Data using Relational Data Explorer alt >

Insert Data using Relational Data Explorer

Open the Relational Data Explorer from the DbSchema Editors menu. Press the ‘+’ icon on the table bottom bar to insert new data records.


Insert Data using SQL Editor >

Insert Data using the SQL Editor

Right-click any table header in the layout and choose Build SQL / Insert Data.


Import the Data using the Data Loader alt >

Import the Data using the Data Importer

Choose Tools / Data Importer from the DbSchema menu. Choose the file to import ( can be CSV, XML or Excel).


Import Data alt >

Data Importer - Choose and Edit the Target Columns

We can change the data type and the length.


Insert Data choose Data Type alt >

Data Importer - Edit the Column Data Type and Length

We can change the data type and the length.


Conclusion

Inserting data into a table in MySQL is a simple process. You just need to select the database that contains the table and use the __INSERT INTO` command to specify the values you want to insert into the columns of the table

Visually Manage Databases using DbSchema

DbSchema is a databases client and visual designer. DbSchema has a free Community Edition, which can be downloaded here.
DbSchema main features include:

DbSchema Designer alt >

Interactive Diagrams

Design tables, column and foreign keys directly in diagrams, by double-clicking them. Changes will be saved to the design model and, if DbSchema is connected to the database also into the database. More.


Connection Dialog alt >

Simple Connection Dialog

Choose the database location, the user and password, and simply get connected. Choose 'Edit Manually' into the JDBC URL combo to enter a custom URL. More.


Relational Data Explorer alt >

Relational Data Explorer

Explore data from multiple tables simultaneously, using foreign keys or virtual foreign keys. Double-click cells to edit the data. More.


Query Builder alt >

Query Builder

Create SQL Queries featuring JOINS, GROUP BY, ORDER BY just using the mouse. More.


SQL Query Editor alt >

SQL Query Editor

Edit and execute SQL Queries. The editor is autocompletion-enabled. More.


Schema Synchronization alt >

Design Schema in Team & Schema Deployment

DbSchema is using the design model, a copy of the schema structure, independent of the database.
The design model can be saved to file and shared in a team.
Connecting to another database you may compare the design model with the database, commit the differences or merge them in the design model. More.


Dark Theme alt >

Dark Theme

Configurable styles & dark theme. More.


Many features are available in the free Community edition.
The Pro edition adds capabilities to save the design to the model file, design schema in team and deploy the schema on multiple databases.


DbSchema can be downloaded for free. No registration is required.