text: -- creating table
  CREATE TABLE ACTOR (
      ID NUMBER,
      FNAME VARCHAR2(30),
      LNAME VARCHAR2(30),
      GENDER VARCHAR2(1)
  );
  
  CREATE TABLE MOVIE (
      ID NUMBER,
      NAME VARCHAR2(150),
      YEAR NUMBER
  );
  
  CREATE TABLE DIRECTORS (
      ID NUMBER,
      FNAME VARCHAR2(30),
      LNAME VARCHAR2(30)
  );
  
  CREATE TABLE CASTS (
      PID NUMBER,
      MID NUMBER,
      ROLE VARCHAR2(50)
  );
  
  CREATE TABLE MOVIE_DIRECTORS (DID NUMBER, MID NUMBER);
  
  CREATE TABLE GENRE (MID NUMBER, GENRE VARCHAR2(50));
  
  -- adding primary key
  ALTER TABLE
      ACTOR
  ADD
      CONSTRAINT ACTOR_PK PRIMARY KEY (ID);
  
  ALTER TABLE
      MOVIE
  ADD
      CONSTRAINT MOVIE_PK PRIMARY KEY (ID);
  
  ALTER TABLE
      DIRECTORS
  ADD
      CONSTRAINT DIRECTORS_PK PRIMARY KEY (ID);
  
  -- adding foriegn key
  ALTER TABLE
      CASTS
  ADD
      CONSTRAINT CASTS_FK_P FOREIGN KEY (PID) REFERENCES ACTOR (ID);
  
  ALTER TABLE
      CASTS
  ADD
      CONSTRAINT CASTS_FK_M FOREIGN KEY (MID) REFERENCES MOVIE (ID);
  
  ALTER TABLE
      MOVIE_DIRECTORS
  ADD
      CONSTRAINT MOVIE_DIRECTORS_FK_M FOREIGN KEY (MID) REFERENCES MOVIE (ID);
  
  ALTER TABLE
      MOVIE_DIRECTORS
  ADD
      CONSTRAINT MOVIE_DIRECTORS_FK_D FOREIGN KEY (DID) REFERENCES DIRECTORS (ID);
  
  ALTER TABLE
      GENRE
  ADD
      CONSTRAINT GENRE_FK FOREIGN KEY (MID) REFERENCES MOVIE (ID);