# drop all tables #################################################### DROP TABLE IF EXISTS data; # create data table ################################################## CREATE TABLE data ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, lname VARCHAR(20) NOT NULL, fname VARCHAR(20) NOT NULL, upd_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ; INSERT INTO data VALUES(0,'Sultan', 'Sam', CURRENT_TIMESTAMP); INSERT INTO data VALUES(0,'Pefanis','George',CURRENT_TIMESTAMP); INSERT INTO data (lname, fname) VALUES('Martin', 'Susan'); INSERT INTO data (lname, fname) VALUES('Paller', 'Marc'); INSERT INTO data (lname, fname) VALUES('Lee', 'Mary'); INSERT INTO data (lname, fname) VALUES('Katz', 'Eric'); # update data (does not change timestamp) ############################ UPDATE data set fname='Sam' where lname='Sultan'; # Delete and re-insert (changes the timestamp) ####################### DELETE from data where lname='Katz'; INSERT INTO data (lname, fname) VALUES('Katz', 'Eric'); # select data ####################################################### SELECT * from data;