Generating data is very handy. Sometimes, we need to generate data for practice. Sometimes, we want to run performance simulations and need a big table to work with. Other times we might need to generate a sequence such as a time dimension in a data warehouse, or an axis table to join to in an anomaly detection system.

There are many reasons to generate data in SQL, and in this chapter we’ll learn several ways to do that.

The SELECT clause

The most straightforward way to to generate data in SQL is using the SELECT clause:

Get hands-on with 1200+ tech skills courses.