-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 23, 2023 at 04:22 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.4.27

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: `adev_sc_ln_knn`
--

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

--
-- Table structure for table `knn_administrator`
--

CREATE TABLE `knn_administrator` (
  `id_administrator` int(3) NOT NULL,
  `nama` varchar(30) NOT NULL,
  `username` varchar(20) NOT NULL,
  `password` varchar(100) NOT NULL,
  `terdaftar` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `knn_administrator`
--

INSERT INTO `knn_administrator` (`id_administrator`, `nama`, `username`, `password`, `terdaftar`) VALUES
(1, 'Administrator', 'admin', '$2y$10$wBhBSqGGC5kdVbht8r8fF.VFbbEr7UfJr0aVQiXEAbG6oVqJBAkpW', '2021-03-20 09:49:40');

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

--
-- Table structure for table `knn_hasil`
--

CREATE TABLE `knn_hasil` (
  `id_hasil` int(11) NOT NULL,
  `id_testing` int(11) NOT NULL,
  `id_kriteria_nilai` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `knn_hasil`
--

INSERT INTO `knn_hasil` (`id_hasil`, `id_testing`, `id_kriteria_nilai`) VALUES
(1, 1, 1),
(2, 2, 2),
(3, 3, 2);

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

--
-- Table structure for table `knn_kriteria`
--

CREATE TABLE `knn_kriteria` (
  `id_kriteria` int(2) NOT NULL,
  `kriteria` varchar(50) NOT NULL,
  `jenis` int(1) NOT NULL,
  `masukan` int(1) NOT NULL,
  `keterangan` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `knn_kriteria`
--

INSERT INTO `knn_kriteria` (`id_kriteria`, `kriteria`, `jenis`, `masukan`, `keterangan`) VALUES
(1, 'Takaran Saji', 1, 3, 'Dalam Gram (misal : 45)'),
(2, 'Jumlah Saji', 1, 3, 'Per Kemasan (misal : 6)'),
(3, 'Energi Total', 1, 3, 'Isi dengan Angka (misal : 40)'),
(4, 'Klasifikasi', 2, 1, '');

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

--
-- Table structure for table `knn_kriteria_nilai`
--

CREATE TABLE `knn_kriteria_nilai` (
  `id_kriteria_nilai` int(3) NOT NULL,
  `id_kriteria` int(2) NOT NULL,
  `nilai` varchar(30) NOT NULL,
  `bobot` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `knn_kriteria_nilai`
--

INSERT INTO `knn_kriteria_nilai` (`id_kriteria_nilai`, `id_kriteria`, `nilai`, `bobot`) VALUES
(1, 4, 'Bagus', 0),
(2, 4, 'Tidak Bagus', 0);

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

--
-- Table structure for table `knn_penilaian`
--

CREATE TABLE `knn_penilaian` (
  `id_penilaian` int(11) NOT NULL,
  `id_testing` int(11) NOT NULL,
  `id_kriteria` int(2) NOT NULL,
  `id_kriteria_nilai` int(3) NOT NULL,
  `masukan` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `knn_penilaian`
--

INSERT INTO `knn_penilaian` (`id_penilaian`, `id_testing`, `id_kriteria`, `id_kriteria_nilai`, `masukan`) VALUES
(1, 1, 1, 0, 40),
(2, 1, 2, 0, 5),
(3, 1, 3, 0, 60),
(4, 2, 1, 0, 45),
(5, 2, 2, 0, 6),
(6, 2, 3, 0, 45),
(7, 3, 1, 0, 45),
(8, 3, 2, 0, 6),
(9, 3, 3, 0, 40);

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

--
-- Table structure for table `knn_testing`
--

CREATE TABLE `knn_testing` (
  `id_testing` int(11) NOT NULL,
  `kode` varchar(10) NOT NULL,
  `nama` varchar(30) NOT NULL,
  `terdaftar` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `nk` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `knn_testing`
--

INSERT INTO `knn_testing` (`id_testing`, `kode`, `nama`, `terdaftar`, `nk`) VALUES
(1, 'Test 01', 'Test 01', '2023-10-21 05:17:05', 6),
(2, '000001', 'App Test', '2023-10-21 05:29:23', 3),
(3, '000001', 'App Test', '2023-10-23 02:13:16', 3);

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

--
-- Table structure for table `knn_training`
--

CREATE TABLE `knn_training` (
  `id_training` int(11) NOT NULL,
  `kode_training` char(5) NOT NULL,
  `id_kriteria` int(2) NOT NULL,
  `id_kriteria_nilai` int(3) NOT NULL,
  `masukan` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `knn_training`
--

INSERT INTO `knn_training` (`id_training`, `kode_training`, `id_kriteria`, `id_kriteria_nilai`, `masukan`) VALUES
(1, '00001', 1, 0, 40),
(2, '00001', 2, 0, 5),
(3, '00001', 3, 0, 60),
(4, '00001', 4, 2, 0),
(5, '00002', 1, 0, 50),
(6, '00002', 2, 0, 8),
(7, '00002', 3, 0, 40),
(8, '00002', 4, 1, 0),
(9, '00003', 1, 0, 50),
(10, '00003', 2, 0, 7),
(11, '00003', 3, 0, 30),
(12, '00003', 4, 2, 0),
(13, '00004', 1, 0, 70),
(14, '00004', 2, 0, 4),
(15, '00004', 3, 0, 60),
(16, '00004', 4, 1, 0),
(17, '00005', 1, 0, 80),
(18, '00005', 2, 0, 4),
(19, '00005', 3, 0, 80),
(20, '00005', 4, 1, 0),
(21, '00006', 1, 0, 60),
(22, '00006', 2, 0, 6),
(23, '00006', 3, 0, 60),
(24, '00006', 4, 1, 0);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `knn_administrator`
--
ALTER TABLE `knn_administrator`
  ADD PRIMARY KEY (`id_administrator`);

--
-- Indexes for table `knn_hasil`
--
ALTER TABLE `knn_hasil`
  ADD PRIMARY KEY (`id_hasil`);

--
-- Indexes for table `knn_kriteria`
--
ALTER TABLE `knn_kriteria`
  ADD PRIMARY KEY (`id_kriteria`);

--
-- Indexes for table `knn_kriteria_nilai`
--
ALTER TABLE `knn_kriteria_nilai`
  ADD PRIMARY KEY (`id_kriteria_nilai`);

--
-- Indexes for table `knn_penilaian`
--
ALTER TABLE `knn_penilaian`
  ADD PRIMARY KEY (`id_penilaian`);

--
-- Indexes for table `knn_testing`
--
ALTER TABLE `knn_testing`
  ADD PRIMARY KEY (`id_testing`);

--
-- Indexes for table `knn_training`
--
ALTER TABLE `knn_training`
  ADD PRIMARY KEY (`id_training`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `knn_administrator`
--
ALTER TABLE `knn_administrator`
  MODIFY `id_administrator` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `knn_hasil`
--
ALTER TABLE `knn_hasil`
  MODIFY `id_hasil` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `knn_kriteria`
--
ALTER TABLE `knn_kriteria`
  MODIFY `id_kriteria` int(2) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `knn_kriteria_nilai`
--
ALTER TABLE `knn_kriteria_nilai`
  MODIFY `id_kriteria_nilai` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `knn_penilaian`
--
ALTER TABLE `knn_penilaian`
  MODIFY `id_penilaian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `knn_testing`
--
ALTER TABLE `knn_testing`
  MODIFY `id_testing` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `knn_training`
--
ALTER TABLE `knn_training`
  MODIFY `id_training` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
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 */;
