Except where otherwise noted, the contents of this presentation are Copyright 2010 Marty Stepp and Jessica Miller.
INSERT
statementINSERT INTO table VALUES (value, value, ..., value);
INSERT INTO Student VALUES (789, "Nelson", "muntz@fox.com");
UPDATE
statementUPDATE table SET column = value, ..., column = value WHERE column = value;
UPDATE Student SET email = "lisasimpson@gmail.com" WHERE SID = 888;
CREATE TABLE
statementCREATE TABLE name ( columnName type constraints, ... columnName type constraints );
CREATE TABLE Student ( SID INTEGER UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(20), email VARCHAR(32) );
NOT NULL
for a field that cannot be blank or PRIMARY KEY
for a column that must be unique for every rowCREATE DATABASE
, DROP TABLE
BOOLEAN
INTEGER
DOUBLE
VARCHAR
: a stringDATE
, TIME
, DATETIME
BLOB
: binary data