\!h You know the album has three columns but forgot their order:
INSERT INTO album (artist_id, album_id, album_name) -- you make your own order
VALUES (7, 2, "Oedipus Schmoedipus");
-- Using this approach, you only need to insert values for some columns, not all.
-- A good example of this is the 'played' table:
INSERT INTO played (artist_id, album_id, track_id)
VALUES (7, 1, 1);
-- the fourth column, 'played', already has a default of CURRENT_TIMESTAMP. This means it will automatically insert the current date and time.
\!h Same approach but for bulk insertion:
INSERT INTO played (artist_id, album_id, track_id)
VALUES (7, 1, 2), (7, 1, 3), (7, 1, 4); -- inserts 3 new track_ids
-- can accidentally omit values for columns
-- to fix that, use the DEFAULT keyword:
INSERT INTO played (7, 1, 2, DEFAULT);
\!h Another alternative INSERT syntax:
INSERT INTO played
SET artist_id = 7, album_id = 1, track_id = 1; -- column name and value together
-- can't be used for bulk insertion
-- can accidentally omit values for columns
-- need to remember and type column names