• views are virtual tables
  • create to conglomerate data without denormalizing, or to restrict data access for users
  • CREATE VIEW viewname AS [some select statement;
  • CREATE VIEW db_class_assign AS SELECT assignmentid FROM class_assignment WHERE classid=9;
  • CREATE VIEW db_class_assign AS SELECT assignmentid, note, max_score FROM class_assignment, assignment WHERE classid=9 AND assignmentid = assignment.id;
  • the view's select statements cannot contain subqueries, only JOINs
  • once created, just select things as desired from the view
  • views automatically update, since they are only a window unto the data in the tables
  • NEXT
    PREVIOUS
    Master Index