0% found this document useful (0 votes)
20 views1 page

Movies Database

The document contains SQL commands to create tables for an actor, director, movies, movie cast, and rating database with primary and foreign keys defined between the tables.

Uploaded by

study material
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Movies Database

The document contains SQL commands to create tables for an actor, director, movies, movie cast, and rating database with primary and foreign keys defined between the tables.

Uploaded by

study material
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

create table ACTOR(

Act_id varchar(10) primary key,


Act_Name varchar(30),
Act_Gender varchar(6));

Create table DIRECTOR(


Dir_id varchar(10) primary key,
Dir_Name varchar(30),
Dir_Phone number(10));

create table MOVIES(


Mov_id varchar(10) primary key,
Mov_Title varchar(20),
Mov_Year date,
Mov_Lang varchar(10),
Dir_id varchar(10),
Foreign key(Dir_id) references DIRECTOR(Dir_id) on delete cascade);

create table MOVIE_CAST(


Act_id varchar(10),
Mov_id varchar(10),
Role varchar(20),
primary key(Act_id,Mov_id),
Foreign key(Act_id) references ACTOR(Act_id) on delete cascade,
Foreign key(Mov_id) references MOVIES(Mov_id) on delete cascade);

create table RATING(


Mov_id varchar(10) primary key,
Rev_Stars number(2,2),
Foreign key(Mov_id) references MOVIES(Mov_id) on delete cascade);

select * from tab;

You might also like