SQL: Insert into a table + Parrot memes🦜

Yeah, we’ve all been there. SQL can be hard! 🐦
Create SQL Tables + panda memes 🐼
https://ineedmoreplates.medium.com/create-sql-tables-panda-memes-8f10973a3859
CREATE TABLE parrots( 🦜🦜🦜  
name VARCHAR(50),
age INTEGER,
species VARCHAR(50)
feed VARCHAR(50)
);
INSERT INTO parrots(name, age, species, feed)
VALUES('charlie',14,'african grey', 'parrot mix #7');
INSERT INTO parrots
---------------------------
INSERT INTO <--- What we want to do!
parrots <--- Where? the parrots table of course!
Our code:INSERT INTO parrots(name, age, species, feed) ----------------------------------Format: INSERT INTO table_name (column1, column2, column3, ...)
This is ok...INSERT INTO parrots(age, name, species,feed)
VALUES(14,'charlie','african grey', 'parrot mix #7');
This is ok...INSERT INTO parrots(name, age, species,feed)
VALUES('charlie',14,'african grey', 'parrot mix #7');
This is NOT ok...INSERT INTO parrots(age, name, species,feed)
VALUES('charlie',14,'african grey', 'parrot mix #7');
Our code:INSERT INTO parrots(name, age, species,feed)
VALUES('charlie',14,'african grey', 'parrot mix #7');
--------------------------------------------------Format:INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
Our code:INSERT INTO parrots(name, age, species,feed)
VALUES
('Magumbae',14,'african grey', 'parrot mix #7'),
('John snow',6,'sulphur-crested cockatoo', 'apples & cashews'),
('Felix',32,'rainbow macaw', 'fresh mango');
--------------------------------------------------Format:INSERT INTO table_name (column1, column2, column3, ...)
VALUES
(value1, value2, value3, ...),
(value1, value2, value3, ...),
(value1, value2, value3, ...);
Now that’s just plucky
More on SQL Inserts: https://www.w3schools.com/sql/sql_insert.asp

--

--

Career Changer, Software Engineer & Web Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store