From the course: SQL for Non-Programmers

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Creating Calculated Fields

Creating Calculated Fields - SQL Tutorial

From the course: SQL for Non-Programmers

Creating Calculated Fields

You have command of your data. You're using it to answer more complex questions. Now let's learn to make calculations using our data with the help of calculated fields. For example, if you have a column of data for base salary and another column for bonus, maybe you want to add the two together to create a new output total salary. Rather than categorizing the data like we did with CASE statements, we may need to perform calculations by manipulating the data we have. Calculated fields, also called computed columns, allow you to use simple expressions to compute new fields of data to work with. You can create these new fields or columns based on one or more existing columns in your data table. These new fields that you create are not physically stored in the table, and you can create them on the fly with many different options available for working with both letters and numbers. Let's look into how we can use calculated fields on our Two Trees Olive Oil data. Join me back in SLS…

Contents