Because data tables are related together using primary and foreign key fields, information can be retrieved out of multiple tables and pieced together again into a single location. This is called a view. In this video, Adam demonstrates how to create this extremely handy component to any SQL database.
- [Voiceover] Because our data tables are related together…using primary and foreign key fields,…we can pull information out of multiple tables…and piece it together again into a single location.…This is called a view,…and it's an extremely handy component to any SQL database.…To demonstrate how they work,…I wanna first explore a couple of tables…inside of our wide world importers database.…We'll find the tables folder and expand it open,…and then I'm going to find a table called sales.invoices…and it's right here.…If I expand that table open,…we can find the columns folder here.…We'll expand that open to see all the different columns…that are inside.…
The invoice ID is the primary key for this table,…and I can tell that based off of this gold key icon,…but we also have a foreign key or a relationship…using this customer ID field right here.…Notice that if we were to look through…all the other columns,…it wouldn't find any information about an address…or details that would allow us to deliver this order.…In order to find that information,…
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