How To Insert a New Row into a Table

Q

How To Insert a New Row into a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements

✍: FYIcenter.com

A

To insert a new row into a table, you should use the INSERT INTO statement with values specified for all columns as shown in the following example:

mysql> INSERT INTO fyi_links VALUES (101, 
  'dev.fyicenter.com', 
  NULL,
  0,
  '2006-04-30');
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> SELECT id, url, notes, counts, DATE(created) 
   FROM fyi_links;
+-----+-------------------+-------+--------+---------------+
| id  | url               | notes | counts | DATE(created) |
+-----+-------------------+-------+--------+---------------+
| 101 | dev.fyicenter.com | NULL  |      0 | 2006-04-30    |
+-----+-------------------+-------+--------+---------------+
1 row in set (0.05 sec)

2007-05-11, 4749👍, 0💬