Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the relational database equivalent of Factorial and the Fibonacci function?

When learning a new programming language there are always a couple of traditional problems that are good to get yourself moving. For example, Hello world and Fibonacci will show how to read input, print output and compute functions (the bread and butter that will solve basically everything) and while they are really simple they are nontrivial enough to be worth their time (and there is always some fun to be had by calculating the factorial of a ridiculously large number in a language with bignums)

So now I'm trying to get to grips with some SQL system and all the textbook examples I can think of involve mind-numbingly boring tables like "Student" or "Employee". What nice alternate datasets could I use instead? I am looking for something that (in order of importance) ...

  1. The data can be generated by a straightforward algorithm.
    • I don't want to have to enter things by hand.
    • I want to be able to easily increase the size of my tables to stress efficiency, etc
  2. Can be used to showcase as much stuff as possible. Selects, Joins, Indexing... You name it.
  3. Can be used to get back some interesting results.
    • I can live with "boring" data manipulation if the data is real and has an use by itself but I'd rather have something more interesting if I am creating the dataset from scratch.

In the worst case, I at least presume there should be some sort of benchmark dataset out there that would at least fit the first two criteria and I would love to hear about that too.

like image 711
hugomg Avatar asked Oct 26 '11 22:10

hugomg


1 Answers

The benchmark database in the Microsoft world is Northwind. One similar open source (EPL) one is Eclipse's Classic Models database.

You can't autogenerate either as far as I know.

However, Northwind "imports and exports specialty foods from around the world", while Classic Models sells "scale models of classic cars". Both are pretty interesting. :)

like image 160
Matthew Flaschen Avatar answered Sep 16 '22 18:09

Matthew Flaschen