O'Reilly logo

Sams Teach Yourself Microsoft® SQL Server T-SQL in 10 Minutes, Second Edition by Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 21. Using Views

In this lesson, you learn exactly what views are, how they work, and when they should be used. You also see how views can be used to simplify some of the SQL operations performed in earlier lessons.

Understanding Views

Views are virtual tables. Unlike tables that contain data, views simply contain queries that dynamically retrieve data when used.

The best way to understand views is to look at an example. Back in Lesson 14, “Joining Tables,” you used the following SELECT statement to retrieve data from three tables:

Input Image

SELECT cust_name, cust_contact FROM customers, orders, orderitems

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required