DROP USER OMALERT_DEMO CASCADE;

CREATE USER OMALERT_DEMO IDENTIFIED BY DEMO DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;

GRANT CONNECT, RESOURCE TO "OMALERT_DEMO";
GRANT CREATE PUBLIC SYNONYM TO "OMALERT_DEMO";
GRANT DROP PUBLIC SYNONYM TO "OMALERT_DEMO";

CONNECT OMALERT_DEMO/DEMO@&CONNECT_STRING

DROP TABLE OMALERT_DEMO.ACCOUNT CASCADE CONSTRAINTS ;

CREATE TABLE OMALERT_DEMO.ACCOUNT (
  ID              NUMBER (10),
  ACCOUNT_NUMBER  VARCHAR2 (10),
  BALANCE         NUMBER (10,2),
  PERSON_ID       NUMBER (10) ) ;


GRANT ALL ON OMALERT_DEMO.ACCOUNT TO PUBLIC;

DROP TABLE OMALERT_DEMO.PERSON CASCADE CONSTRAINTS ;

CREATE TABLE OMALERT_DEMO.PERSON (
  ID       NUMBER (10),
  NAME     VARCHAR2 (100),
  ADDRESS  VARCHAR2 (200) ) ;


GRANT ALL ON OMALERT_DEMO.PERSON TO PUBLIC;


DROP PUBLIC SYNONYM ACCOUNT;

DROP PUBLIC SYNONYM PERSON;


CREATE PUBLIC SYNONYM ACCOUNT FOR OMALERT_DEMO.ACCOUNT;

CREATE PUBLIC SYNONYM PERSON FOR OMALERT_DEMO.PERSON;

