| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Views Example using Registration System

Page history last edited by Dr. Ron Eaglin 11 years, 1 month ago

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.