CST 333 Database Systems (Online)
Homework Assignment #4 (Max: 12 pts)
Exercise 1 (2 pts)
Write a CHECK constraint that expresses the following condition on attribute Rating in table Movies in Movie Database: “Any possible value of Rating is either a null value or a number in the interval from 0 to 10 inclusively”.
Exercise 2 (2 pts)
Write a CHECK constraint that expresses the following condition on records in table Laptop in Hardware Database: “If the screen is larger than 20, then the price is higher than 2000”.
Exercise 3 (2 pts)
Write a CHECK constraint that expresses the following condition on table Schedule in University Database: “Each course (occurring in this table) is offered at least two times”. Hint: Use NOT EXISTS.
Exercise 4 (2 pts)
Write a CHECK constraint that expresses the following condition on table StarsIn in Movie Database: