To add data to a table, use the INSERT command. Let’s see this in action by populating the table classics with the data.
Example 🙂 Populating the classics table
INSERT INTO classics(author, title, type, year)
VALUES(‘Markku Aro’,’30 suosikkia’,’POP’,’1998′);
INSERT INTO classics(author, title, type, year)
VALUES(‘Lenni Kalle’,’parhaat’,’klassikko’,’1811′);
INSERT INTO classics(author, title, type, year)
VALUES(‘Esa Mäkelä”,’Ketsuppia saksasta’,’POP’,’1990′);
INSERT INTO classics(author, title, type, year)
VALUES(‘Matti ja Teppo”,’kautta aikain parhaat’,’iskelmä’,’1975′);
INSERT INTO classics(author, title, type, year)
VALUES(‘Suvi Teräsniska’,’30 parhainta ‘,’POP’,’2020′);
After every second line, you should see a Query OK message. Once all lines have been entered, type the following command, which will display the table’s contents.
Use next command to read content:
SELECT * FROM classics;