Getting started with SQL

The table I made keeps track of several projects that I've done while at ITP.

First, I created a table with 5 fields: id (INT), project (VARCHAR) class (VARCHAR), start_date (DATE), and rating (DOUBLE).


Second, with some trial and error, I inserted five records. The consolidated command used in the SQL window would have been:

INSERT INTO Projects (id, project, class, start_date, rating) VALUES (0, 'animation w flash', 'com lab','2006-11-26','5'), (1, 'birds the word','pcomp','2007-04-17','5'), (2, 'm5 bus ride', 'applications','2006-11-21','2'), (3, 'a lot more fun','icm','2007-10-03','4'), (4, 'on point','tactical media','2007-03-22','3');


Next, for the queries:

  Numeric - SELECT * FROM `Projects` WHERE id = 2;

  Text - SELECT * FROM `Projects` WHERE class LIKE '%tactical%';

  Date - SELECT * FROM `Projects` WHERE start_date = '2007-04-17';


To update a record, I used UPDATE `Projects` SET rating=4 WHERE id=0;


Lastly, I removed the 5th record with the command DELETE FROM `Projects` WHERE id=4;