Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases SQL Basics Getting Data from a Database Your First SQL Statement

Download Link for the databases

Can you please add a download link for the databases in the download link?

3 Answers

Steven Parker
Steven Parker
231,184 Points

I've never seen any of the playground databases provided for downloading. But this particular database is small enough that you could easily re-create it by copy/pasting the columns from the playground. You could paste into "insert" statements or perhaps into a spreadsheet that you could export.

A few years ago I posted a method for converting a larger database more directly in an answer to this other question. But it's a bit tricky, and probably not worth the effort for this small data set.

Ben McMahan
Ben McMahan
7,922 Points

Here is the SQL to add the data to the books table. Note that id is the primary key and auto-incrementing (Google if you aren't familiar with those terms)

--
-- Dumping data for table `books`
--

INSERT INTO `books` (`id`, `title`, `author`, `genre`, `first_published`) VALUES
(1, 'Harry Potter and the Philosopher\'s Stone', 'J.K. Rowling', 'Fantasy', 1997),
(2, 'Harry Potter and the Chamber of Secrets', 'J.K. Rowling', 'Fantasy', 1998),
(3, 'Harry Potter and the Prisoner of Azkaban', 'J.K. Rowling', 'Fantasy', 1999),
(4, 'Harry Potter and the Goblet of Fire', 'J.K. Rowling', 'Fantasy', 2000),
(5, '   Harry Potter and the Order of the Phoenix', 'J.K. Rowling', 'Fantasy', 2003),
(6, 'Harry Potter and the Half-Blood Prince', 'J.K. Rowling', 'Fantasy', 2005),
(7, 'Harry Potter and the Deathly Hallows', 'J.K. Rowling', 'Fantasy', 2007),
(8, 'A Brief History of Time', 'Stephen King', 'Non Fiction', 1988),
(9, 'The Universe in a Nutshell', 'Stephen King', 'Non Fiction', 2001),
(10, 'Frankenstein', 'Mary Shelley', 'Horror', 1818),
(11, 'The Martian', 'Andy Weir', 'Science Fiction', 2014),
(12, 'Ready Player One', 'Ernest Cline', 'Science Fiction', 2011),
(13, 'Armada', 'Ernest Cline', 'Science Fiction', 2015),
(14, 'Pride and Prejudice', 'Jane Austen', 'Classic', 1813),
(15, 'Emma', 'Jane Austen', 'Classic', 1815);

Thanks for the table, how can I access it within the VS code?

Oh, no. I think this is for like storing login credentials. What you want, I believe is what they call uh file transfer protocol um ftp. You're looking for ftp applications.