Long description

Back

Statement 1: INSERT INTO ArtWorks open parenthesis Title comma YearOfWork comma Artist I D close parenthesis VALUES open parenthesis open single quote Night Watch close single quote comma 1642 comma 105 close parenthesis. INSERT INTO is labeled SQL keywords for inserting (adding) a new record. ArtWorks is labeled Table name. Title comma YearOfWork comma Artist I D is labeled Fields that will receive the data values. open single quote Night Watch close single quote comma 1642 comma 105 is labeled Values to be inserted. Note that string values must be within quotes (single or double). Note: Primary key fields are often set to AUTO_INCREMENT, which means the DBMS will set it to a unique value when a new record is inserted.

Statement 2: INSERT INTO ArtWorks SET Title equals open single quote Night Watch close single quote comma YearOfWork equals 1642 comma Artist I D equals 105. SET Title equals open single quote Night Watch close single quote comma YearOfWork equals 1642 comma Artist I D equals 105 is labeled Nonstandard alternate MySQL syntax, which is useful when inserting record with many fields (less likely to insert wrong data into a field).

Statement 3: UPDATE ArtWorks SET Title equals open single quote Night Watch close single quote comma YearOfWork equals 1642 comma Artist I D equals 105 WHERE ArtWork I D equals 54. Title equals open single quote Night Watch close single quote comma YearOfWork equals 1642 comma Artist I D equals 105 is labeled Specify the values for each updated field. Note: Primary key fields that are AUTO_INCREMENT cannot have their values updated. WHERE ArtWork I D equals 54 is labeled It is essential to specify which record to update, otherwise it will update all the records!

Statement 4: DELETE FROM ArtWorks WHERE ArtWork I D equals 54. WHERE ArtWork I D equals 54 is labeled It is essential to specify which record to delete, otherwise it will delete all the records!

Back