Weld logo
SQL TUTORIAL • LESSON 26, Tips & Tricks

Formatting best practices

You can pretty well format your code as you like — capitalized letters, spaces, indents, and line breaks don’t influence the result in SQL. This is great, because it means you can use your formatting to make your code easier to read. There are different conventions for how to structure your code, and you might develop your own style. But here are some suggestions of how to best format your code:

  • Field names and functions should be lowercase
  • When using alias use the ‘as’ keyword
  • Use line breaks & indents to make your code more readable
  • Have space after a comma and on both side of operators
  • Use preceding commas

Next up

Documenting your code

Go to lesson
Weld logo

Tired of scattered data? Sync data to your data warehouse with Weld in minutes with our powerful ETL, SQL Transformations, Reverse ETL and AI Assistant, Ed - connected to 100+ apps, files and databases.

Backed by leading investors
Frontline logoCherry logoInnnovation Fund logo
Twitter LogoLinkedIn Logo
GDPR logoSOC2
© 2024 Weld. All rights reserved.