From the course: Learning Microsoft SQL Server 2016

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Use functions to calculate values

Use functions to calculate values - SQL Server Tutorial

From the course: Learning Microsoft SQL Server 2016

Start my 1-month free trial

Use functions to calculate values

- [Voiceover] Besides pulling information out of our database in an organized fashion, queries will allow us to view a bigger picture of what's going on within the organization. We can use queries to combine values together in new ways to give us more insight than what the raw data can reveal alone. To see how this works, I'm going to find a table inside of my WideWorldImporters database called Sales.OrderLines. I'll right click on it and choose Select Top 1000 Rows. In the results window, we can see that each order line includes data on the quantity of products that were ordered, the unit price for each product, and the tax rate that's applied to the order. Using these values, we can calculate a total amount due for each order line. To do this, we'll start a new query by pressing the New Query button on the standard tool bar. We'll start with a standard select query. I'll type in the keyword, Select and the columns that we're interested in: OrderLineID, Quantity, UnitPrice, and…

Contents