You are on page 1of 2

--create table Routes

create table Route(

r_no number(5) NOT NULL,

v_Name varchar(100)

);

--Foreign key definition for Route_Nodes

alter table Route

add CONSTRAINT FK_r_no

FOREIGN KEY(r_no)

REFERENCES Route_Nodes(r_no);

insert into Route values(1,'Bagmati Yatayat');

--Create table Nodes

create table Nodes(

Name varchar(50),

Latitude varchar(10) NOT NULL UNIQUE,

Longitude varchar(10) NOT NULL UNIQUE

);
--Cereate table Route_Nodes

create table Route_Nodes(

r_no number(3) NOT NULL,

node VARCHAR2(4000)

);

--primary key definition

alter table Route_Nodes

add constraints PK_r_no

PRIMARY KEY(r_no);

insert into Route_Nodes values(1,'{1:Kalanki,2:Kalimati,3:Maitidevi}');

You might also like