Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Software ==> | SQL (203 exercises) |
Topic ==> | Views (7 exercises) |
Level ==> | Average difficulty |
Subject ==> | SQL training |
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
If you haven't already done so, run the script in the above folder to generate the Doctor Who database.
Create a new query, and write script to create a new view. This should begin:
USE DoctorWho
-- script to create a new view
CREATE VIEW vwSeriesOne
-- create a view to show series 1 episodes
SELECT
Note that there are two vital words missing from the above excerpt of SQL, which you'll need to include!
Finish your script so that it creates a view to show all of the episodes in series 1, then execute the script to create your view:
-- show all of the rows returned from the view
SELECT * FROM vwSeriesOne
Select all of the rows in your view - this should show the 13 episodes which comprise series one:
The first few of the 13 episodes in series 1.
Right-click on your view in Object Explorer and choose to change it:
Choose to change the design of your view.
Amend the criteria to show all of the episodes in series 2, not 1, then save and close your view. When you script your view, you should now see that you've lost all of your formatting and comments!
You can find other training resources for the subject of this exercise here:
From: | Orin |
When: | 25 Feb 24 at 17:56 |
Figuring out what came wrong since my first attempt, using the provided beginning of the script ended in "Msg 111, Level 15, State 1, Line 3
'CREATE VIEW' must be the first statement in a query batch."
- your solution saved query contains ALTER instead of CREATE = once changed, it does create the view.
- we need to add AS after the view name, seems logical
- we finally need a GO after the Database name and at the end of the query.
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.