From the course: Learning Relational Databases

Unlock the full course today

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

Create views in SQL Server

Create views in SQL Server

From the course: Learning Relational Databases

Start my 1-month free trial

Create views in SQL Server

- [Instructor] I've gone ahead and added some additional records to the Two Trees database, and I'd like to demonstrate how SQL Server can piece together records from separate tables to give some useful information. First, let's take a look at the line items table. I'll right click on it in the Two Trees database and choose Select Top 1,000 Rows. This will display four columns of information. We have the Invoice ID that it's linked to, so we can see we have data on Invoice ID number one and invoice ID number three. Within each invoice, we have a different number of line items. So on invoice number one, we have line items one and two. And on invoice three, we have lines one, two, and three. Each of these lines represent an order for a specific product. Here we have the Product ID numbers of those referenced in the products table, over here in the table. And finally, we have a column for the quantity. This is the number of bottles of each oil that were ordered. So we can see that line…

Contents