Not all data needs to be permanently stored in the database. Some information can be calculated from known values. In this video, Adam uses simple mathematical calculations to determine a total amount due from an order quantity, unit price, and tax rate. Functions are introduced to format the calculation result into the currency data type format.
- [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 TaxRate.…On the next line, I'll type in the From clause,…
This course introduces the most important features of SQL Server 2016, and is designed to act as the student's very first look at how the server operates. Adam Wilbert shows how to install a local copy of SQL Server; demonstrates the working environment, SQL Server Management Studio; and walks students through their first hour creating tables, defining relationships, and writing and running queries with Transact-SQL commands. Everything you need to accomplish to create your first database is covered in just 80 minutes. Start watching to get up and running with this professional-grade database management system.
- What is SQL Server?
- Configuring the server
- Creating a new database and data tables
- Joining tables with keys
- Creating a SELECT statement
- Writing an UPDATE statement
- Adding data with the INSERT statement