From the course: SQL Server 2008 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Joining multiple tables together - SQL Server Tutorial
From the course: SQL Server 2008 Essential Training
Joining multiple tables together
After awhile you are going to find that be very straightforward SQL statements, like this one where I'm simply selecting three pieces of data from the Product table, well they don't get all that fantastically useful. What I'm retrieving here is the name of a product, the color of the product, and the ProductCategoryID, which in this case is 18 or 27 or 23, which is not all that helpful if I'm just reading this data. I want to know what the category is. Well I know that my database has the category stored in it but it's not in this table and here's why. I have got a simple diagram that's just showing these parts of this AdventureWorksLT database. There is a Product table with all these columns in and then there a ProductCategory table and this is simply good normalization. We can have multiple products in category, so it's a good idea to take that category data out and put it in its own table. And what this really means for MySQL statement is I want one SQL statement to be retrieving…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Introduction to Transact-SQL3m 43s
-
(Locked)
Using SELECT statements7m 16s
-
(Locked)
Changing the default database2m 21s
-
(Locked)
Creating conditions in SQL8m 10s
-
(Locked)
Sorting your output3m 23s
-
(Locked)
Using aggregate functions7m 12s
-
(Locked)
Finding unique values2m 14s
-
(Locked)
Joining multiple tables together8m
-
(Locked)
Using subqueries9m 33s
-
(Locked)
Viewing execution plans3m 37s
-
(Locked)
-
-
-
-
-
-
-
-
-