Object relational database management
- Creating objects
- CREATE TABLE Countries
(name text, boundary polygon, population integer, language text);
- CREATE TABLE Frames
(Frameno integer, image jpeg_image, category integer);
- CREATE TABLE Categories
(Cid integer, Name text, lease_price float, comments text);
- CREATE ROW TYPE theater_t
(T_no integer, Name text, Address text, Phone text);
- CREATE TABLE Theaters OF TYPE theater_t;
- CREATE TABLE Nowshowing
(Film integer, theater ref(theater_t), start date, end date);
- CREATE TABLE Films
(Filmno integer, title text, stars setof (text), director text, budget float);
- Queries:
- select frame number, image thumbnail, and price of al frames that contain
Herbert and a sunrise
- Q1: SELECT F.Frameno, thumbnail(F.image), C.lease_price
FROM Frames F, Categories C
WHERE F.Category = C.Cid AND is_sunrise(F.image) AND
is_herbert(F.image);