3 the total percentage of all appointments for an

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: grity constraints in SQL. View - rows are not explicitly stored, but computed as needed from view definition Base table - explicitly stored 2. Every manager must also be an employee. 3. The total percentage of all appointments for an employee must be under 100%. 4. A manager must always have a higher salary than any employee that he or she manages. 59 60 CREATE VIEW CREATE VIEW (continued) Given tables for these relations: Students (ID, name, major) (ID Enrolled (ID, CourseID, grade) (ID CREATE VIEW ActiveSailors (name, age, day) AS SELECT S.sname, S.age, R.day S.sname, S.age, FROM Sailors S, Reserves R WHERE S.sid = R.sid AND S.rating > 6; Can create view: CREATE VIEW B-Students (name, ID, CourseID) AS BCourseID) SELECT S.name, S.ID, E.CourseID S.name, FROM Students S, Enrolled E WHERE S.ID = E.ID AND E.grade = ‘B’; 61 61 62 Restrictions on MySQL View Definitions DROP VIEW DROP VIEW B-Students; B- For restrictions on MySQL view definitions, see: http://dev.mysql.com/doc/refman/5.0/en/create-view.html http://dev.mysql.com/doc/refman/5.0/en/create- DROP VIEW ActiveSai...
View Full Document

This note was uploaded on 10/15/2012 for the course CSE 4503 taught by Professor Edallen during the Fall '12 term at Mississippi State.

Ask a homework question - tutors are online