-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 31, 2024 at 06:49 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.0.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `spk_status_gizi`
--

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

--
-- Table structure for table `balita`
--

CREATE TABLE `balita` (
  `kdbalita` bigint(20) UNSIGNED NOT NULL,
  `balita` varchar(50) NOT NULL,
  `id_role` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `balita`
--

INSERT INTO `balita` (`kdbalita`, `balita`, `id_role`) VALUES
(11, 'Bilal Hariz Attahilah', 1),
(16, 'Karisma Pramu Dita', 2),
(17, 'Ahmat Alfin Alfarizi', 1),
(18, 'Naylatul Basmala', 2),
(19, 'Azkia Ainun Niswah', 2),
(20, 'Kahyang Galuh Rahayu', 2),
(21, 'Candra Cahyo Saputro', 1),
(22, 'Aghna Hanin Hana', 2),
(23, 'Bima Arta Dwi C', 1),
(24, 'Nadhira Putri Azmi', 2),
(25, 'Najma Adiba Al', 2),
(26, 'Assyaka Syakil Fatansyah', 1),
(27, 'Shafeeya Alhumaira', 2),
(28, 'Shafana Kumaisaroh', 2),
(29, 'Thalita Aina Rahma', 2),
(30, 'Ahmad Syaufan A', 1),
(31, 'Dhimas Rahmat Hidayat', 1),
(32, 'Ardika Keona Pratiwi', 2),
(33, 'Saila Aimatus S', 2),
(34, 'Ilham Nur Rahman', 1),
(35, 'Anisatul Mahawil', 2),
(36, 'Tsaqila Raicandra P', 2),
(37, 'Rohiqul Nazar', 1),
(38, 'Wendi Saputra', 1),
(40, 'Revan Yulianto', 1);

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

--
-- Table structure for table `data_balita`
--

CREATE TABLE `data_balita` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama_balita` varchar(255) NOT NULL,
  `nik` varchar(255) NOT NULL,
  `nama_orangtua` varchar(255) NOT NULL,
  `alamat_rt_rw` varchar(255) NOT NULL,
  `jenis_kelamin` tinyint(4) NOT NULL COMMENT '1: Laki-laki, 2: Perempuan',
  `tanggal_timbang` date NOT NULL,
  `tanggal_lahir` date NOT NULL,
  `umur_bulan` int(11) NOT NULL,
  `berat_badan` decimal(5,2) NOT NULL,
  `tinggi_badan` decimal(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `data_balita`
--

INSERT INTO `data_balita` (`id`, `nama_balita`, `nik`, `nama_orangtua`, `alamat_rt_rw`, `jenis_kelamin`, `tanggal_timbang`, `tanggal_lahir`, `umur_bulan`, `berat_badan`, `tinggi_badan`, `created_at`, `updated_at`) VALUES
(11, 'Bilal Hariz Attahilah', '3523061906220001', 'Susi', 'RT 01 / RW 01', 1, '2023-02-15', '2022-06-20', 8, 7.10, 72.00, '2024-03-13 20:25:26', '2024-03-13 20:25:26'),
(16, 'Karisma Pramu Dita', '3523066004220001', 'Alfiana', 'RT 04 / RW 01', 2, '2023-02-15', '2022-04-21', 10, 9.00, 73.00, '2024-03-13 21:19:43', '2024-03-13 21:19:43'),
(17, 'Ahmat Alfin Alfarizi', '3523061306220001', 'Sukarti', 'RT 04 / RW 01', 1, '2023-02-15', '2022-06-13', 8, 11.10, 77.00, '2024-03-13 22:04:22', '2024-03-13 22:04:22'),
(18, 'Naylatul Basmala', '3523066706220002', 'Khilmia', 'RT 02 / RW 01', 2, '2023-02-15', '2022-06-27', 8, 8.10, 75.00, '2024-03-13 22:06:04', '2024-03-13 22:06:04'),
(19, 'Azkia Ainun Niswah', '3523066806980001', 'Tutut', 'RT 01 / RW 01', 2, '2023-02-15', '2022-07-15', 7, 8.00, 70.00, '2024-03-13 22:07:00', '2024-03-13 22:07:00'),
(20, 'Kahyang Galuh Rahayu', '3523065908220001', 'Rohmatul', 'RT 04 / RW 02', 2, '2023-02-15', '2022-08-19', 6, 7.40, 65.00, '2024-03-16 23:48:52', '2024-03-16 23:48:52'),
(21, 'Candra Cahyo Saputro', '3523060605220001', 'Lista', 'RT 04 / RW 02', 1, '2023-02-15', '2022-05-06', 9, 8.20, 78.00, '2024-03-16 23:51:23', '2024-03-16 23:51:23'),
(22, 'Aghna Hanin Hana', '3523064402210001', 'Devi Nur Q', 'RT 04 / RW 03', 2, '2023-02-15', '2021-02-09', 24, 12.60, 83.00, '2024-03-16 23:52:41', '2024-03-16 23:52:41'),
(23, 'Bima Arta Dwi C', '3523061211210001', 'Novita C', 'RT 01 / RW 03', 1, '2023-02-15', '2021-11-12', 15, 10.80, 76.00, '2024-03-16 23:53:45', '2024-03-16 23:53:45'),
(24, 'Nadhira Putri Azmi', '3523067101210002', 'Susekowati', 'RT 03 / RW 01', 2, '2023-02-15', '2021-01-31', 25, 9.40, 92.00, '2024-03-16 23:58:14', '2024-03-16 23:58:14'),
(25, 'Najma Adiba Al', '3523125509210001', 'Nurma R', 'RT 04 / RW 02', 2, '2023-02-15', '2021-09-15', 17, 7.00, 80.00, '2024-03-17 00:00:02', '2024-03-17 00:00:02'),
(26, 'Assyaka Syakil Fatansyah', '3578061508210001', 'Wiwit P R', 'RT 03 / RW 01', 1, '2023-02-15', '2021-09-14', 17, 17.80, 83.00, '2024-03-17 00:01:49', '2024-03-17 00:01:49'),
(27, 'Shafeeya Alhumaira', '3523066803180001', 'Vevi', 'RT 01 / RW 01', 2, '2023-02-15', '2018-03-28', 59, 18.00, 102.00, '2024-03-17 00:04:16', '2024-03-17 00:04:16'),
(28, 'Shafana Kumaisaroh', '3523065209180001', 'Ruminah', 'RT 01 / RW 01', 2, '2023-02-15', '2018-09-12', 53, 18.70, 104.00, '2024-03-17 00:11:16', '2024-03-17 00:11:16'),
(29, 'Thalita Aina Rahma', '3523065812180001', 'Supikah', 'RT 01 / RW 01', 2, '2023-02-15', '2018-12-18', 50, 11.90, 99.00, '2024-03-17 00:14:54', '2024-03-17 00:14:54'),
(30, 'Ahmad Syaufan A', '3523062412180001', 'Zulaekah', 'RT 03 / RW 01', 1, '2023-02-15', '2018-12-24', 50, 13.00, 97.00, '2024-03-17 00:21:06', '2024-03-17 00:21:06'),
(31, 'Dhimas Rahmat Hidayat', '3523061312180001', 'Dina Af', 'RT 03 / RW 01', 1, '2023-02-15', '2018-12-13', 50, 11.40, 96.00, '2024-03-17 00:24:54', '2024-03-17 00:24:54'),
(32, 'Ardika Keona Pratiwi', '3523046008190002', 'Rizky', 'RT 03 / RW 01', 2, '2023-02-15', '2019-08-20', 42, 20.30, 99.00, '2024-03-17 00:29:13', '2024-03-17 00:29:13'),
(33, 'Saila Aimatus S', '3523066105190003', 'Sriwati', 'RT 01 / RW 01', 2, '2023-02-15', '2019-12-02', 38, 9.10, 85.00, '2024-03-17 00:32:00', '2024-03-17 00:32:00'),
(34, 'Ilham Nur Rahman', '3523062510180001', 'Sambiyah', 'RT 02 / RW 02', 1, '2023-02-15', '2018-10-25', 52, 12.30, 95.00, '2024-03-17 00:41:03', '2024-03-17 00:41:03'),
(35, 'Anisatul Mahawil', '3523064703200001', 'Aminatun', 'RT 04 / RW 01', 2, '2023-02-15', '2020-03-07', 35, 11.00, 93.00, '2024-03-17 00:47:16', '2024-03-17 00:47:16'),
(36, 'Tsaqila Raicandra P', '3523066811200001', 'Ninik Dwi R', 'RT 03 / RW 01', 2, '2023-02-15', '2020-11-28', 27, 11.00, 91.00, '2024-03-17 00:48:31', '2024-03-17 00:48:31'),
(37, 'Rohiqul Nazar', '3523060205180002', 'Katini', 'RT 02 / RW 02', 1, '2023-02-15', '2019-05-02', 45, 13.40, 102.00, '2024-03-17 00:50:07', '2024-03-17 00:50:07'),
(38, 'Wendi Saputra', '3523062211180001', 'Suparti', 'RT 01 / RW 05', 1, '2023-02-15', '2018-11-22', 51, 12.80, 100.00, '2024-03-17 00:51:50', '2024-03-17 00:51:50'),
(40, 'Revan Yulianto', '3523062301190001', 'Sutiah', 'RT 01 / RW 05', 1, '2023-02-15', '2019-01-23', 49, 13.30, 102.00, '2024-03-25 22:33:28', '2024-03-25 22:33:28');

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

--
-- Table structure for table `kriteria`
--

CREATE TABLE `kriteria` (
  `kdKriteria` bigint(20) UNSIGNED NOT NULL,
  `kriteria` varchar(100) NOT NULL,
  `sifat` char(1) NOT NULL,
  `bobot` int(11) NOT NULL,
  `detail` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kriteria`
--

INSERT INTO `kriteria` (`kdKriteria`, `kriteria`, `sifat`, `bobot`, `detail`) VALUES
(1, 'C1', 'B', 50, 'Berat Badan'),
(2, 'C2', 'B', 50, 'Tinggi Badan');

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2023_10_29_132002_create_kriteria_table', 1),
(3, '2023_10_29_132009_create_role_table', 1),
(4, '2023_10_29_132010_create_balita_table', 1),
(5, '2023_10_29_132012_create_subkriteria_table', 1),
(6, '2023_10_29_132021_create_nilai_table', 1),
(7, '2023_11_04_085636_create_balitas_table', 1);

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

--
-- Table structure for table `nilai`
--

CREATE TABLE `nilai` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `kdbalita` bigint(20) UNSIGNED NOT NULL,
  `kdKriteria` bigint(20) UNSIGNED NOT NULL,
  `nilai` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `nilai`
--

INSERT INTO `nilai` (`id`, `kdbalita`, `kdKriteria`, `nilai`) VALUES
(21, 11, 1, 3),
(22, 11, 2, 3),
(31, 16, 1, 3),
(32, 16, 2, 3),
(33, 17, 1, 4),
(34, 17, 2, 3),
(35, 18, 1, 3),
(36, 18, 2, 3),
(37, 19, 1, 3),
(38, 19, 2, 3),
(39, 20, 1, 3),
(40, 20, 2, 3),
(41, 21, 1, 3),
(42, 21, 2, 3),
(43, 22, 1, 3),
(44, 22, 2, 3),
(45, 23, 1, 3),
(46, 23, 2, 3),
(47, 24, 1, 3),
(48, 24, 2, 3),
(49, 25, 1, 2),
(50, 25, 2, 3),
(51, 26, 1, 4),
(52, 26, 2, 3),
(53, 27, 1, 3),
(54, 27, 2, 3),
(55, 28, 1, 3),
(56, 28, 2, 3),
(57, 29, 1, 2),
(58, 29, 2, 3),
(59, 30, 1, 3),
(60, 30, 2, 3),
(61, 31, 1, 2),
(62, 31, 2, 3),
(63, 32, 1, 4),
(64, 32, 2, 3),
(65, 33, 1, 1),
(66, 33, 2, 2),
(67, 34, 1, 2),
(68, 34, 2, 2),
(69, 35, 1, 3),
(70, 35, 2, 3),
(71, 36, 1, 3),
(72, 36, 2, 3),
(73, 37, 1, 3),
(74, 37, 2, 3),
(75, 38, 1, 3),
(76, 38, 2, 3),
(79, 40, 1, 3),
(80, 40, 2, 3);

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

--
-- Table structure for table `role`
--

CREATE TABLE `role` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role`
--

INSERT INTO `role` (`id`, `nama`) VALUES
(1, 'laki-laki'),
(2, 'perempuan');

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

--
-- Table structure for table `subkriteria`
--

CREATE TABLE `subkriteria` (
  `kdSubKriteria` bigint(20) UNSIGNED NOT NULL,
  `subKriteria` varchar(50) NOT NULL,
  `value` int(11) NOT NULL,
  `kdKriteria` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `subkriteria`
--

INSERT INTO `subkriteria` (`kdSubKriteria`, `subKriteria`, `value`, `kdKriteria`) VALUES
(5, 'Sangat Pendek', 1, 2),
(6, 'Pendek', 2, 2),
(7, 'Normal', 3, 2),
(8, 'Tinggi', 4, 2),
(13, 'Sangat Kurang', 1, 1),
(14, 'Kurang', 2, 1),
(15, 'Normal', 3, 1),
(16, 'Lebih', 4, 1);

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `roles` enum('admin','penguji') NOT NULL DEFAULT 'penguji',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `username`, `password`, `roles`, `created_at`, `updated_at`) VALUES
(1, 'Dwi Nur Ellisa', 'admin', '$2y$10$0Z73JjpUidpFFMlxRIA.2ucVNDWB/DLGup9xads8sa9USMkKCywoi', 'admin', '2024-01-10 07:57:50', '2024-01-10 07:57:50');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `balita`
--
ALTER TABLE `balita`
  ADD PRIMARY KEY (`kdbalita`),
  ADD KEY `balita_id_role_foreign` (`id_role`);

--
-- Indexes for table `data_balita`
--
ALTER TABLE `data_balita`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `kriteria`
--
ALTER TABLE `kriteria`
  ADD PRIMARY KEY (`kdKriteria`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `nilai`
--
ALTER TABLE `nilai`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `nilai_kdbalita_kdkriteria_unique` (`kdbalita`,`kdKriteria`),
  ADD KEY `nilai_kdkriteria_foreign` (`kdKriteria`);

--
-- Indexes for table `role`
--
ALTER TABLE `role`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `subkriteria`
--
ALTER TABLE `subkriteria`
  ADD PRIMARY KEY (`kdSubKriteria`),
  ADD KEY `subkriteria_kdkriteria_foreign` (`kdKriteria`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_username_unique` (`username`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `balita`
--
ALTER TABLE `balita`
  MODIFY `kdbalita` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- AUTO_INCREMENT for table `data_balita`
--
ALTER TABLE `data_balita`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- AUTO_INCREMENT for table `kriteria`
--
ALTER TABLE `kriteria`
  MODIFY `kdKriteria` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `nilai`
--
ALTER TABLE `nilai`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=81;

--
-- AUTO_INCREMENT for table `role`
--
ALTER TABLE `role`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `subkriteria`
--
ALTER TABLE `subkriteria`
  MODIFY `kdSubKriteria` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `balita`
--
ALTER TABLE `balita`
  ADD CONSTRAINT `balita_id_role_foreign` FOREIGN KEY (`id_role`) REFERENCES `role` (`id`);

--
-- Constraints for table `nilai`
--
ALTER TABLE `nilai`
  ADD CONSTRAINT `nilai_kdbalita_foreign` FOREIGN KEY (`kdbalita`) REFERENCES `balita` (`kdbalita`),
  ADD CONSTRAINT `nilai_kdkriteria_foreign` FOREIGN KEY (`kdKriteria`) REFERENCES `kriteria` (`kdKriteria`);

--
-- Constraints for table `subkriteria`
--
ALTER TABLE `subkriteria`
  ADD CONSTRAINT `subkriteria_kdkriteria_foreign` FOREIGN KEY (`kdKriteria`) REFERENCES `kriteria` (`kdKriteria`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
