create table "PediatricChartAuthority"(
		"PediatricChartAuthorityId" serial primary key,
		"AuthorityName" text,
		"CreatedBy" int references "Account"("AccountId"),
		"CreatedDate" timestamp without time zone,
		"ModifiedBy" int references "Account"("AccountId"),
		"ModifiedDate" timestamp without time zone,
		"Active" bool default true
);

create table "PediatricChartType"(
			"PediatricChartTypeId" serial primary key,
			"TypeName" varchar(20),
			"Active" bool default true
);

create table "PediatricAgeWiseData"(
			"PediatricAgeWiseDataId" serial primary key,
			"PediatricChartAuthorityId" int references "PediatricChartAuthority"("PediatricChartAuthorityId"),
			"PediatricChartTypeId" int references "PediatricChartType"("PediatricChartTypeId"),
			"Gender" varchar(10),
			"AgeInMonth" int ,
			"SD" int default null,
			"P1" int,
			"P3" int,
			"P5" int,
			"P15" int,
			"P25" int,			
			"P50" int,
			"P75" int,
			"P85" int,
			"P95" int,
			"P97" int,
			"P99" int,
			"CreatedBy" int references "Account"("AccountId"),
			"CreatedDate" timestamp without time zone,
			"ModifiedBy" int references "Account"("AccountId"),
			"ModifiedDate" timestamp without time zone,
			"Active" bool default true			
);

INSERT INTO public."PediatricChartType"
("TypeName", "Active")
VALUES('BMI', true),('Height', true),('Weight', true),('HeadCircumference', true);
