438 Part I EXAM PREPARATION APPLY YOUR KNO
438 Part I EXAM PREPARATION APPLY YOUR KNO WLEDGE PRIMARY KEY CHECK (Identification BETWEEN 1 and 20), Name varchar(20) ) CREATE TABLE member2 ( Identification INT PRIMARY KEY CHECK (Identification BETWEEN 21 and 40), Name varchar(20) ) 3. Now INSERT some example data into the member tables you created in Step 1. To do this, execute the following queries: INSERT member1 (Identification, Name) VALUES ( 7 , Abraham ) INSERT member1 (Identification, Name) VALUES ( 18 , Jauna ) INSERT member2 (Identification, Name) VALUES ( 23 , John ) INSERT member2 (Identification, Name) VALUES ( 36 , Dennis ) 4. To create a view that combines these two member tables, execute the following: CREATE VIEW AllProducts AS SELECT * FROM member1 UNION ALL SELECT * FROM member2 5. Test your new view by running a SELECT against it. You should have a complete listing of all four records. Exercise 7.4 Accessing a View This exercise shows you how to access a view by displaying its definition and dependencies. Being able to research a view s definition and dependencies is useful when trying to find out why a view may not be working. Estimated Time: 10 minutes. 1. Open the SQL Server Query Analyzer by selecting it from the Start menu. Log in and select the Pubs database. 2. Create a new view by executing the following query: CREATE VIEW BusinessTitleView AS SELECT * FROM titles WHERE type = business 3. To access the definition of this view, execute the following: EXEC sp_helptext TitleView 4. To display any view dependencies, use the following query: sp_depends TitleView Review Questions 1. Describe in relative terms how much data a view is capable of containing and the storage requirements that may be necessary for a view. 2. How does the CHECK constraint help in the implementation of partitioned views? 3. What is the advantage of creating a view that is
For reliable and cheap web hosting services please check javaweb hosting website.