Views Example using Registration System
This example and video demonstrates using the registration system database and creating a complex view that joins 5 tables. This does not demonstrate options for the joins - but does demonstrate the concepts of creating a view.
Video
http://online1.daytonastate.edu/player2.php?id=7fd804295ef7f6a2822bf4c61f9dc4a8
Code
This uses the Case Study - Registration Database
use RegistrationDatabase
Go
CREATE VIEW view_registration
AS
SELECT
FirstNameText + ' ' + LastNameText AS 'Name',
Prefix + Number AS 'Course',
term_identifier + [Year] AS 'Term'
FROM
Students,
StudentEnrollment,
CourseOffering,
Courses,
Semesters
WHERE
Students.id = StudentEnrollment.StudentID
AND
CourseOffering.id = StudentEnrollment.CourseOfferingID
AND
Courses.id = CourseOffering.CourseID
AND
Semesters.id = CourseOffering.SemesterID
|
Comments (0)
You don't have permission to comment on this page.