There's more...

Like a book or a beautiful picture, we also need to take care with how we write a query. We can either use SQLA or Teradata Studio Express for this purpose. The main thing is, our query should be readable and should easily be understood.

Ctrl + Q auto formats the query in SQLA and Teradata Studio Express.
  • Keep individual SQL statements small as they are easier to debug and support. 
  • Always qualify table names with database names; default database assignments can change. 
  • Use ANSI join syntax with join criteria in the ON clause, not in the WHERE clause. Join the clause on one line, tableA inner join tableB, and use a separate line for each criteria.
  • Use a separate line for each table in the form list.
  • When using subqueries, ...

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.