-- https://www.phpmyadmin.net/
--

START TRANSACTION;



-- --------------------------------------------------------

--
-- Table structure for table `diagnosa`
--

CREATE TABLE `diagnosa` (
  `id_diagnosa` int(10) NOT NULL,
  `data_diagnosa` date NOT NULL,
  `resultadu_moras` int(10) DEFAULT NULL,
  `valor_cf` decimal(5,4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

--
-- Table structure for table `moras`
--

CREATE TABLE `moras` (
  `id_moras` int(10) NOT NULL,
  `kode_moras` varchar(50) NOT NULL,
  `naran_moras` varchar(150) NOT NULL,
  `deskrisaun` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `moras`
--

INSERT INTO `moras` (`id_moras`, `kode_moras`, `naran_moras`, `deskrisaun`) VALUES
(1, 'M005', 'Defisiénsia Nutrisaun', 'Kondisaun ne\'ebé mosu tanba animál la hetan hahán ho nutrisaun, vitamina, ka minerál ne\'ebé natoon.'),
(2, 'M004', 'Mastitis', 'Infesaun ka inflamasaun iha animál inan nia susun. Halo susun bubu, mean, moras, no bele afeta maka\'as ba kualidade no kuantidade susube.'),
(3, 'M003', 'Parazita Interna', 'Infesaun husi lombriga ka parazita seluk iha animál nia kabun laran (intestinu). Halo animál isin-lotuk, fulun krakat, no menus.'),
(4, 'M002', 'Diare', 'Kondisaun ne\'ebé halo animál tee-been (feses líkidu) beibeik. Baibain kauza husi infesaun, hahán aat, ka bee fo\'er, ne\'ebé bele halo animál.'),
(5, 'M001', 'Infesaun Saluran Respirasaun', 'Moras ne\'ebé ataka sistema dada-iis (pulmaun no inus), baibain kauza husi bakteria ka virus. Halo animál me\'ar, inus');

-- --------------------------------------------------------

--
-- Table structure for table `rezultadu`
--

CREATE TABLE `rezultadu` (
  `id_rezultadu` int(10) NOT NULL,
  `naran_user` varchar(100) NOT NULL,
  `id_moras` int(10) DEFAULT NULL,
  `valor_cf` decimal(5,4) DEFAULT NULL,
  `dikrisaun` varchar(500) DEFAULT NULL,
  `data_rezultadu` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `rezultadu`
--

INSERT INTO `rezultadu` (`id_rezultadu`, `naran_user`, `id_moras`, `valor_cf`, `dikrisaun`, `data_rezultadu`) VALUES
(1, 'Aurio', 2, '0.9000', 'Moras bakteria grave ne ebe kauza moras dadauk iha animal', '2026-06-14 21:23:01'),
(2, 'Aurio', 1, '0.8000', 'Moras viral ne ebe afeta animal hoof no ibun, rahun iha ain no ibun', '2026-06-14 21:23:01'),
(3, 'Aurio', 5, '0.8000', 'Moras parasita ne ebe transmite hosi carraça, afeta selula ran', '2026-06-14 21:23:01'),
(4, 'Aurio', 4, '0.7000', 'Moras respiratory sistema iha karau, susar iis', '2026-06-14 21:23:01'),
(5, 'Zerson', 2, '0.7000', 'Moras bakteria grave ne ebe kauza moras dadauk iha animal', '2026-06-14 21:24:47'),
(6, 'Zerson', 1, '0.6000', 'Moras viral ne ebe afeta animal hoof no ibun, rahun iha ain no ibun', '2026-06-14 21:24:47'),
(7, 'Zerson', 3, '0.6000', 'Moras bakteria ne ebe afeta sistema reproduksaun karau', '2026-06-14 21:24:47'),
(8, 'Zerson', 4, '0.6000', 'Moras respiratory sistema iha karau, susar iis', '2026-06-14 21:24:47'),
(9, 'Zerson', 5, '0.6000', 'Moras parasita ne ebe transmite hosi carraça, afeta selula ran', '2026-06-14 21:24:47');

-- --------------------------------------------------------

--
-- Table structure for table `rules_cf`
--

CREATE TABLE `rules_cf` (
  `id_rules` int(10) NOT NULL,
  `id_moras` int(10) NOT NULL,
  `id_sintoma` int(10) NOT NULL,
  `nilai_cf` decimal(4,2) NOT NULL COMMENT 'Nilai CF pakar (0.0 - 1.0)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `rules_cf`
--

INSERT INTO `rules_cf` (`id_rules`, `id_moras`, `id_sintoma`, `nilai_cf`) VALUES
(1, 1, 1, '0.80'),
(2, 1, 3, '0.90'),
(3, 1, 4, '0.90'),
(4, 1, 2, '0.60'),
(5, 1, 6, '0.70'),
(6, 2, 1, '0.90'),
(7, 2, 9, '0.80'),
(8, 2, 12, '0.70'),
(9, 2, 2, '0.70'),
(10, 2, 13, '0.80'),
(12, 3, 2, '0.60'),
(13, 3, 12, '0.70'),
(14, 4, 9, '0.90'),
(15, 4, 1, '0.70'),
(16, 4, 2, '0.60'),
(18, 5, 1, '0.80'),
(19, 5, 7, '0.80'),
(20, 5, 11, '0.70'),
(21, 5, 2, '0.60'),
(22, 5, 5, '0.70');

-- --------------------------------------------------------

--
-- Table structure for table `sintoma`
--

CREATE TABLE `sintoma` (
  `id_sintoma` int(10) NOT NULL,
  `kode_sintoma` varchar(30) NOT NULL,
  `naran_sintoma` varchar(50) NOT NULL,
  `deskrisaun` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `sintoma`
--

INSERT INTO `sintoma` (`id_sintoma`, `kode_sintoma`, `naran_sintoma`, `deskrisaun`) VALUES
(1, 'S01', 'Manas aas', 'Temperatura isin aas liu 39°C'),
(2, 'S02', 'La han', 'Karau la nia apetitu atu han'),
(3, 'S03', 'Ibun rahun', 'Rahun/bura iha ibun no ain'),
(4, 'S04', 'Ain inxadu', 'Ain inxadu no moras bainhira toke'),
(5, 'S010', 'Tee ben', 'Fekun bee ka konsisténsia bee.'),
(6, 'S009', 'Kabun bubu', 'Kabun sai boot ka sente kembung.'),
(7, 'S008', 'Inus been sai', 'Inus-been suli sai husi inus (flu).'),
(8, 'S007', 'Matan mean', 'Matan-mutin sai mean tanba iritasaun ka moras.'),
(9, 'S006', 'Apetite', 'Mudansa ba hakarak atu han (la hakarak han ka han la iha nafsu).'),
(10, 'S005', 'Temperatura isin manas', 'Isin moras ka isin manas liu fali fali grau normál.'),
(11, 'S004', 'Susar atu toba', 'Sente susar atu toba'),
(12, 'S003', 'atividade menus', 'Isin sente fraku atu halo atividade loron-loron ni'),
(13, 'S002', 'dada iis araska', 'iha susar ka sente todan bainhira dada iis'),
(16, 'S001', 'Iis boot', 'Iis ne\'ebé sa\'e maka\'as ka lalais liu fali baibain.');

--
-- Indexes for table `diagnosa`
--
ALTER TABLE `diagnosa`
  ADD PRIMARY KEY (`id_diagnosa`),
  ADD KEY `resultadu_moras` (`resultadu_moras`);

--
-- Indexes for table `moras`
--
ALTER TABLE `moras`
  ADD PRIMARY KEY (`id_moras`);

--
-- Indexes for table `rezultadu`
--
ALTER TABLE `rezultadu`
  ADD PRIMARY KEY (`id_rezultadu`),
  ADD KEY `id_moras` (`id_moras`);

--
-- Indexes for table `rules_cf`
--
ALTER TABLE `rules_cf`
  ADD PRIMARY KEY (`id_rules`),
  ADD KEY `id_moras` (`id_moras`),
  ADD KEY `id_sintoma` (`id_sintoma`);

--
-- Indexes for table `sintoma`
--
ALTER TABLE `sintoma`
  ADD PRIMARY KEY (`id_sintoma`);

--
-- AUTO_INCREMENT for table `diagnosa`
--
ALTER TABLE `diagnosa`
  MODIFY `id_diagnosa` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `moras`
--
ALTER TABLE `moras`
  MODIFY `id_moras` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `rezultadu`
--
ALTER TABLE `rezultadu`
  MODIFY `id_rezultadu` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `rules_cf`
--
ALTER TABLE `rules_cf`
  MODIFY `id_rules` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `sintoma`
--
ALTER TABLE `sintoma`
  MODIFY `id_sintoma` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `diagnosa`
--
ALTER TABLE `diagnosa`
  ADD CONSTRAINT `diagnosa_ibfk_1` FOREIGN KEY (`resultadu_moras`) REFERENCES `moras` (`id_moras`) ON DELETE SET NULL;

--
-- Constraints for table `rezultadu`
--
ALTER TABLE `rezultadu`
  ADD CONSTRAINT `rezultadu_ibfk_1` FOREIGN KEY (`id_moras`) REFERENCES `moras` (`id_moras`) ON DELETE SET NULL;

--
-- Constraints for table `rules_cf`
--
ALTER TABLE `rules_cf`
  ADD CONSTRAINT `rules_cf_ibfk_1` FOREIGN KEY (`id_moras`) REFERENCES `moras` (`id_moras`) ON DELETE CASCADE,
  ADD CONSTRAINT `rules_cf_ibfk_2` FOREIGN KEY (`id_sintoma`) REFERENCES `sintoma` (`id_sintoma`) ON DELETE CASCADE;
COMMIT;

