movierental - DROP DROP DROP DROP DROP D DROP TABLE...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
DROP TABLE MM_MOVIE_TYPE CASCADE CONSTRAINTS PURGE; DROP TABLE mm_pay_type CASCADE CONSTRAINTS PURGE; DROP TABLE mm_member CASCADE CONSTRAINTS PURGE; DROP TABLE mm_movie CASCADE CONSTRAINTS PURGE; DROP TABLE mm_rental CASCADE CONSTRAINTS PURGE; DROP SEQUENCE mm_rental_seq; D CREATE TABLE mm_movie_type (movie_cat_id NUMBER(2), movie_category VARCHAR(12), CONSTRAINT movie_cat_id_pk PRIMARY KEY (movie_cat_id)); CREATE TABLE mm_pay_type (payment_methods_id NUMBER(2), payment_methods VARCHAR(14), CONSTRAINT payment_methods_id_pk PRIMARY KEY (payment_methods_id)); CREATE TABLE mm_member (member_id NUMBER(4), last VARCHAR(12), first VARCHAR(8), license_no VARCHAR(9), license_st VARCHAR(2), credit_card VARCHAR(12), suspension VARCHAR(1) DEFAULT 'N', mailing_list VARCHAR(1), CONSTRAINT cust_custid_pk PRIMARY KEY (member_id), CONSTRAINT cust_credcard_ck CHECK (LENGTH(credit_card) = 12)); CREATE TABLE mm_movie (movie_id NUMBER(4), movie_title VARCHAR(40), movie_cat_id NUMBER(2) NOT NULL, movie_value DECIMAL(5,2), movie_qty NUMBER(2), CONSTRAINT movies_id_pk PRIMARY KEY (movie_id), CONSTRAINT movie_type_fk FOREIGN KEY (movie_cat_id) REFERENCES mm_movie_type(movie_cat_id), CONSTRAINT movies_value_ck CHECK (movie_value BETWEEN 5 and 100)); CREATE TABLE mm_rental (rental_id NUMBER(4), member_id NUMBER(4), movie_id NUMBER(4), checkout_date DATE DEFAULT SYSDATE, checkin_date DATE, payment_methods_id NUMBER(2), CONSTRAINT rentals_pk PRIMARY KEY (rental_id), CONSTRAINT member_id_fk FOREIGN KEY (member_id) REFERENCES mm_member(member_id), CONSTRAINT movie_id_fk FOREIGN KEY (movie_id)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

movierental - DROP DROP DROP DROP DROP D DROP TABLE...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online