Skip to content

VARCHAR

CREATE TABLE Customers (
CustomerName VARCHAR(255),
ContactName VARCHAR(255)
);
INSERT INTO Customers (CustomerName, ContactName)
VALUES ('Cardinal', 'Tom B. Erichsen');
Query OK, 0 rows affected (0.03 sec)
Query OK, 1 row affected (0.00 sec)

In this example, a new table named “Customers” is created with two columns: CustomerName and ContactName. Both columns are defined by the VARCHAR data type with a maximum character length of 255. A new row is then inserted into the Customers table, with ‘Cardinal’ and ‘Tom B. Erichsen’ as the values for the CustomerName and ContactName columns, respectively.