June 2005
Intermediate
720 pages
20h 6m
English
After your database and its table(s) have been created, you can start populating them using the INSERT command. Before demonstrating the syntax, I want to be explicit as to how you should treat the different data types in your SQL commands. Always abide by these rules:
Numeric values shouldn’t be quoted.
String values (for CHAR, VARCHAR, and TEXT column types) must always be quoted.
Date and time values must always be quoted.
Functions cannot be quoted.
The word NULL must not be quoted.
With that in mind, there are two formats for inserting data. With the first, you specify the columns to be used:
INSERT INTO tablename (column1, → column2 ...) VALUES ('value1', → 'value2' ...) INSERT INTO tablename (column4, → column8) VALUES ('valueX', ...
Read now
Unlock full access