Every complete example in this document is available in a zip file that you can download from the attachment in the left sidebar. The zip file includes a SQL script file that creates the input tables for the examples.
The examples and SQL script are also available at https://downloads.teradata.com.