
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Add Values into Columns of a MySQL Table
INSERT command is used to add values to the columns of a MySQL table. We need to specify the values in INSERT command for all the columns as follows −
Syntax
INSERT INTO table_name values(value1,value2,…)
Example
Suppose we have a table named ‘Stock’ with three columns ‘Item_id’, ‘Item_name’ and ‘Item_rate’ then with the help of following query we can add values in these columns.
mysql> INSERT INTO Stock values(1,'HistoryBook',250); Query OK, 1 row affected (0.07 sec) mysql> INSERT INTO Stock values(2,'DBMSBook',280); Query OK, 1 row affected (0.10 sec) mysql> Select * from Stock; +---------+-------------+-----------+ | item_id | Item_name | Item_rate | +---------+-------------+-----------+ | 1 | HistoryBook | 250 | | 2 | DBMSBook | 280 | +---------+-------------+-----------+ 2 rows in set (0.00 sec)
Advertisements