Bummer! You have been redirected as the page you requested could not be found.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
![](https://videos.teamtreehouse.com/stills/TH-CRUD_Basics_S1V2-stills-1.jpg?token=69972200_1f22a2571647da7c406946cf70e4539bf0954c81)
- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In this video, we'll take a look at adding rows of information into a table.
SQL Used
Inserting a single row:
INSERT INTO <table> VALUES (<value 1>, <value 2>, ...);
This will insert values in the order of the columns prescribed in the schema.
Examples:
INSERT INTO users VALUES (1, "chalkers", "Andrew", "Chalkley");
INSERT INTO users VALUES (2, "ScRiPtKiDdIe", "Kenneth", "Love");
INSERT INTO movies VALUES (3, "Starman", "Science Fiction", 1984);
INSERT INTO movies VALUES (4, "Moulin Rouge!", "Musical", 2001);
Inserting a single row with values in any order:
INSERT INTO <table> (<column 1>, <column 2>) VALUES (<value 1>, <value 2>);
INSERT INTO <table> (<column 2>, <column 1>) VALUES (<value 2>, <value 1>);
Examples:
INSERT INTO users (username, first_name, last_name) VALUES ("chalkers", "Andrew", "Chalkley");
INSERT INTO users (first_name, last_name, username) VALUES ("Kenneth", "Love", "ScRiPtKiDdIe");
INSERT INTO movies (title, genre, year_released) VALUES ("Starman", "Science Fiction", 1984);
INSERT INTO movies (title, year_released, genre) VALUES ("Moulin Rouge!", 2001, "Musical");
See all of the SQL used in Modifying Data With SQL in the Modifying Data With SQL Cheatsheet.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
karan Badhwar
Web Development Techdegree Graduate 18,135 Points1 Answer
-
nicolaspeterson
8,569 Points1 Answer
-
Joseph Lander
Full Stack JavaScript Techdegree Graduate 27,765 Points1 Answer
-
Michael Newman
39,508 Points1 Answer
-
Hanna Han
4,105 Points1 Answer
-
PLUS
pmacsdesigners
Courses Plus Student 6,583 Points1 Answer
-
Abram McCreary
1,371 Points1 Answer
-
Laura Kyle
19,794 PointsResource suggestions for learning about schema design?
Posted by Laura KyleLaura Kyle
19,794 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up