1Insert Into

In SQL we can insert data into tables by executing simple queries:

Syntax

USE [database];  --or select your db by clicking in MySQL workbench

INSERT INTO [table] (column1, column2, ...)   --specify your columns
VALUES (value1, value2, ...);                 --data to be added, in order of columns

This will add data to our columns.

Example of Inserting Data:

USE db;  --or select your db by clicking in MySQL workbench

INSERT INTO users (userid, username, user_address)   --specify your columns
VALUES (105, "williambenz", "Washington Road 15");   --Our data

Notice how we have to use quotation-marks("" or '') for strings. This is important as SQL will reject our query otherwise.

If you would like Free Sample Data to insert to your database, please click here


Last updated