Tags | sql |
Hard Prerequisites | |
IMPORTANT: Please review these prerequisites, they include important information that will help you with this content. | |
|
You’ve heard of Libraries right? In the old times people used to go to libraries to borrow books made out of dead trees. Libraries need to keep track of a lot of stuff. Let’s see if you can figure out how to use an SQL database to manage a Library’s info.
Many small PRs are better than one big one. You are more likely to be successful if you get rapid feedback. This exercise should have 3 PRs.
If your SQL is a lil rusty we got you. Or rather, these guys got you:
You’re going to need to know how to make tables, how foreign keys work, and some select statements and joins.
Before we can use a database, we’ll need to define some table structures. Please create a script that can be executed to create all the tables we need. We’ll need to represent the following information:
Every book has the following attributes (columns):
Ok, some books in real life have more than one author. But to keep things simple let’s just pretend that one book only has one author.
Every author has:
Of course a library is way more complicated than this - there are people who borrow books and owe fines and membership fees and all sorts of things. But for now we want the bare basics. So that’s it for now. Just books and authors. And one book only gets one author.
Get some feedback on what you have done so far!
Write a script that populates your database.
Make another script. Please write queries to achieve the following: