Skip to content

Instantly share code, notes, and snippets.

@fversnel
Last active May 10, 2018 23:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fversnel/982d26d8a5dd1ecc5db272167934b779 to your computer and use it in GitHub Desktop.
Save fversnel/982d26d8a5dd1ecc5db272167934b779 to your computer and use it in GitHub Desktop.
Extra database assignments

Extra assignments

Here are some extra assignments for everyone who has finished the database homework and couldn't get enough ;).

Indices

Indices are a very important feature to make queries faster.

  1. What is a database index? Explain in your own words.
  2. Considering the world database used in the assignments. Here's a query:

SELECT * FROM city WHERE Population > 5000000;

Which rows in the city table will the DBMS look at to answer your query?

  1. Indices can be implemented with a binary search tree. Draw a binary tree for the Population of the top 24 largest cities.
  2. Explain how the following query SELECT * FROM city WHERE Population > 5000000; will work when we set an index on the Population column. How does the database search the binary tree to answer the query?
  3. Pick a database schema and explain which columns you think should get an index and explain for each column why you think that's a good idea.
  4. Implement a binary search tree that stores numbers in NodeJS.
@gisaac85
Copy link

gisaac85 commented May 10, 2018

Here is my doc file contains extra DB ....
Thanks Frank :)

https://github.com/gisaac85/myPuplicFiles/blob/master/Extra%20DB.docx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment