From the course: Advanced SQL: Solving Interpolation Challenges

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Auxiliary data

Auxiliary data

- [Narrator] The auxiliary tables I'm about to show you are included in every database that I design. The numbers table is more of a technical aid. It has a single column with sequential, positive integers, starting with one, and going up to whatever is appropriate for that database. The query that populates it was inspired by Itsik Ben-Gan article, which I'm going to link in the code file. But, you're free to populate it any way you like. I'm not going to review the syntax. It's sweet. Check it out. Side note, PostgreSQL provides the generate series function that generates a wide variety of series, including sequential integers. However, most other databases don't, and even if you're using PostgreSQL, it may be easier for newcomers to read code that uses a standard table rather than learn the intricacies of the function syntax. The size of the table is negligible, and you will use it more often than you think. In fact,…

Contents