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
Now that our base application is up and running, we're ready to model our data. We know we’ll have a Course object and we also know that we’ll have a Review object. Each course will have possibly many reviews. You might recognize this type of model relationship as one to many. One course, many reviews.
You can download the database here. Or if you prefer, you can set up the database yourself. If you want to create the tables, you can use the following SQL commands:
CREATE TABLE "courses" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`title` TEXT NOT NULL,
`url` TEXT NOT NULL )
CREATE TABLE "reviews" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`course_id` INTEGER NOT NULL,
`rating` INTEGER NOT NULL,
`comment` BLOB NOT NULL )
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated 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