![]() ![]() ![]() There is one table Sarah made that might not seem intuitive to have created - the 'viewings' table. ![]() There are four tables in the movie-buff database: movies, directors, viewers, and viewings. Over the years, they've borrowed a lot of her DVDs, and she's set up a database to keep track of who has watched what so that she can make better recommendations for them based on what they've seen so far. Sarah has a very eclectic taste in movies, but her friends admire it. Or try opening your file using TablePlus. ![]() Play around a bit if you would like! Ask any questions.Īfter successfully running the file, your database should now have 4 tables, directors, movies, viewers, and viewings. read path/to/file.sql STOP HERE and make sure your setup looks ok. Open up this file in vscode - see? SQL is a language like python! (well, not EXACTLY like python, but you can save a file and run it against a database instead of doing everything manually! neat!) Now that we have our database created, we can actually seed (populate) our database, using a. Turn on Foreign Key Constraints for your new Database: PRAGMA foreign_keys = ON Import Tables From. cd DesktopĪfter running that command, you should see the following output: sqlite> For this example, I'll be placing the file on my desktop. Let's start by creating a new database called movie-buff.db. Don't forget to utilize it! Database Setup It's a tool to help you interact with your SQL Database that is a little more user-friendly than your command line. Studio: Databases Part 2 Walkthrough A note about TablePlus ![]()
0 Comments
Leave a Reply. |