Skip to content

Instantly share code, notes, and snippets.

@azlkiniue
Created December 24, 2017 11:39
Show Gist options
  • Save azlkiniue/c78c933834be2daccfc8007e3e6eeab0 to your computer and use it in GitHub Desktop.
Save azlkiniue/c78c933834be2daccfc8007e3e6eeab0 to your computer and use it in GitHub Desktop.
Data base for this repository -> https://github.com/azlkiniue/project-sociolib
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 24, 2017 at 12:33 PM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Database: `sociolib`
--
CREATE DATABASE IF NOT EXISTS `sociolib` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `sociolib`;
-- --------------------------------------------------------
--
-- Table structure for table `anggota`
--
CREATE TABLE `anggota` (
`id` int(5) NOT NULL,
`nama` varchar(50) NOT NULL,
`tgl_lahir` date NOT NULL,
`gender` varchar(2) NOT NULL,
`pekerjaan` varchar(20) NOT NULL,
`alamat` varchar(100) NOT NULL,
`no_hp` varchar(16) DEFAULT NULL,
`jml_buku_donasi` int(5) NOT NULL DEFAULT '0',
`tgl_daftar` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `anggota`
--
INSERT INTO `anggota` (`id`, `nama`, `tgl_lahir`, `gender`, `pekerjaan`, `alamat`, `no_hp`, `jml_buku_donasi`, `tgl_daftar`) VALUES
(1, 'Ahmad Muzakki Alamsyah', '2000-12-03', 'L', 'Pelajar', 'Jalan Kayu Putih 89, Kabupaten Chicago', '+6281237284637', 4, '2016-11-22'),
(2, 'Rizqi Junaedi Ali', '1976-07-20', 'L', 'Karyawan Swasta', 'Jalan Sukosari 899, Boston', '+6281932948777', 1, '2016-11-25'),
(3, 'Vanny Oktavia', '1985-02-12', 'P', 'PNS', 'Jalan Jakarta 86, Surabaya', '+6285736485728', 1, '2016-11-26'),
(4, 'Ruby Sujatmiko', '1980-04-29', 'L', 'Sopir Taxi', 'Jalan Raya Apel 77, South Dakota', '+6287773664859', 1, '2016-11-26'),
(5, 'Nurvita Laili Izzati', '1989-08-14', 'P', 'Guru', 'Jalan Gunung Asri 64, Siak', '+6289978635478', 2, '2016-11-27'),
(6, 'Ahmad Abu Ayman', '1973-01-06', 'L', 'Jurnalis', 'Jalan Westminster 19E, Grogol', '+6287839472047', 0, '2016-11-27'),
(7, 'Anton Nugraha', '1983-11-30', 'L', 'TNI', 'Jalan Pasopati 78, Meulaboh', '+6285739355789', 2, '2016-11-28'),
(8, 'Risma Faridatul Azizah', '1993-06-15', 'P', 'Dokter Gigi', 'Jalan Mulyoringin 53, Nebraska', '+6281335712937', 1, '2016-12-01'),
(9, 'Desy Violita Prameswari', '1990-03-05', 'P', 'Ibu Rumah Tangga', 'Jalan Worcester 88C, Mumbai', '+6281923405475', 0, '2016-12-05'),
(10, 'Gunadi Andirja Stephenson', '1992-01-30', 'L', 'Wiraswasta', 'Jalan Raya Houston 81B, Wonogiri', '+6281928337065', 0, '2017-07-02'),
(11, 'Farah Juliana Khumayroh', '1993-12-31', 'P', 'Fotographer', 'Jalan Bringin Sukoharjo 98, Brooklyn', '+628934582941', 0, '2016-12-13'),
(12, 'Devira Dwi', '1997-03-08', 'P', 'Mahasiswa', 'Sidoarjo', '08971070597', 0, '2016-12-23'),
(13, 'Ahmad Sulaiman', '1964-08-04', 'L', 'PNS', 'Jalan Kenangan 73, Kebumen', '0897765362352', 0, '2016-12-23'),
(14, 'Kay England Soetoro', '1986-09-07', 'P', 'Model', 'Yorkshire Avenue 42, Kabupaten Glasgow', '+6281247823849', 0, '2017-07-02'),
(15, 'Ariane Desmond Suprayitno', '1992-07-15', 'P', 'Jurnalis', 'Jalan R.A. Kartini 87D, Michigan', '+6281243735736', 0, '2017-06-30'),
(16, 'Habibatul Jalilah', '1997-08-14', 'P', 'Guru', 'Jl Tambak Sari, Surabaya', '081224242424', 0, '2017-01-29'),
(17, 'Anita Lestari', '1990-01-15', 'P', 'PNS', 'Jl Ketintang, Surabaya', '081994010101', 0, '2017-02-09'),
(18, 'Meri Aprilia', '1996-04-27', 'P', 'Teknisi', 'Jl Kertajaya Indah Regency', '092172045678', 0, '2017-04-29'),
(19, 'Rahul Mahendra', '1998-12-04', 'L', 'PNS', 'Jl Arif Rahman Hakim', '083180232323', 0, '2017-04-29'),
(20, 'Andri', '1995-03-03', 'L', 'Juru Masak', 'Jl Rungkut, Surabaya', '083180090909', 0, '2017-04-29'),
(21, 'Poni Nugrahadi', '1991-06-28', 'L', 'Doktor', 'Keputih, Sukolilo', '0987672424242', 0, '2017-04-29'),
(22, 'Syarif', '1993-05-05', 'L', 'Dosen', 'Jl Mulyosari Indah', '083180090975', 0, '2017-04-29'),
(23, 'Idrus Sadi', '1994-01-08', 'L', 'PNS', 'Jl Gebang Lor, Surabaya', '082174343434', 0, '2017-03-29'),
(24, 'Edi Rahmana', '1989-07-06', 'L', 'Guru', 'Jl Pakuwon City', '089191050505', 0, '2017-04-29'),
(25, 'Syafrida', '1993-06-06', 'P', 'PNS', 'Jl Kapasan', '0821214646464', 0, '2017-05-01'),
(27, 'Elmi Rozifa', '1996-05-03', 'P', 'Guru', 'Jl Karang Asem', '087878040404', 0, '2017-05-01'),
(28, 'Sari Intan Nadya', '1997-04-09', 'P', 'PNS', 'Jl Karang Asem', '090878090909', 0, '2017-05-01'),
(29, 'Revaldo', '1997-01-01', 'L', 'PNS', 'Jl Kapasari, Surabaya', '080808434343', 0, '2017-05-01'),
(30, 'Ade Saputra', '1997-04-03', 'L', 'PNS', 'Jl Karang Asem', '090909787878', 0, '2017-05-01'),
(31, 'Dodo Amin', '1995-02-02', 'L', 'Guru', 'Jl Mulyorejo', '090909454545', 0, '2017-05-01'),
(32, 'Ilham Maulana', '2001-01-02', 'L', 'Dosen', 'Jl Kertajaya Indah', '090909878787', 0, '2017-05-01'),
(33, 'Doni Gunawan', '1995-07-12', 'L', 'Doktor', 'Jl Ketintang Surabaya', '080808565656', 0, '2017-05-01'),
(34, 'Irdayenti', '1991-02-04', 'P', 'Guru', 'Jl Dharmahusada', '070707454545', 0, '2017-05-01'),
(35, 'Elisa Fitri', '1995-03-15', 'P', 'Dosen', 'Jl DharmaHusada', '050505676767', 0, '2017-05-01'),
(36, 'Husein', '2001-03-09', 'L', 'PNS', 'Jl Karang Asem', '040404767676', 0, '2017-05-01'),
(37, 'Izdihar Tsuraya', '1994-04-07', 'P', 'Ibu Rumah Tangga', 'Jl Manyar Kertoarjo, Surabaya', '060606878787', 0, '2017-05-03'),
(38, 'Rahma Nuraini', '1997-08-08', 'P', 'Dosen', 'Jl. Kenjeran Surabaya', '080808565656', 0, '2017-05-03'),
(39, 'Wanda Dila Sari', '2000-05-26', 'P', 'PNS', 'Jl Kertajaya Indah', '050505454545', 0, '2017-05-03'),
(40, 'Lidya Fatika Ramadhani', '1997-06-06', 'P', 'PNS', 'JL Karang Asem', '080808989898', 0, '2017-05-03'),
(41, 'Ahmad Hafis', '1997-03-03', 'L', 'Polisi', 'Jl Arif Rahman Hakim', '030303676767', 0, '2017-05-07'),
(42, 'Indah Tika Sari', '1998-04-09', 'P', 'Ibu Rumah Tangga', 'Jl Mulyorejo', '050505232323', 0, '2017-05-07'),
(43, 'Melan Aprilia', '1998-01-01', 'P', 'PNS', 'Jl Mulyorejo Baru', '090900343434', 0, '2017-05-07'),
(44, 'Muhammad Hadi', '1998-01-28', 'L', 'PNS', 'Jl Karang Asem', '090909252525', 0, '2017-05-07'),
(45, 'Nur Baiti', '1997-03-19', 'P', 'PNS', 'Jl.Raya Kertajaya Indah', '020202565656', 0, '2017-05-07'),
(46, 'Jefri', '1998-01-16', 'L', 'PNS', 'Jl Tambak Sari', '080808575757', 0, '2017-05-10'),
(47, 'Muhammad Nasir', '1997-04-02', 'L', 'Pengacara', 'Jl Kenjeran', '090909565656', 0, '2017-05-15'),
(48, 'Junaidi', '1990-06-07', 'L', 'Dosen', 'Jl Karang Asem', '040404232323', 0, '2017-05-16'),
(49, 'Muhammad Fasal', '1990-03-03', 'L', 'PNS', 'Jl Mulyorejo Baru', '090909565656', 0, '2017-05-26'),
(50, 'Krisan', '1991-03-03', 'L', 'Guru', 'Jl Dharmahusada', '090906787878', 0, '2017-05-21'),
(51, 'Muhammad Teguh Islami', '1996-02-04', 'L', 'Polisi', 'Jl Tambak Sari', '040404383838', 0, '2017-05-25'),
(52, 'Yusril', '1997-03-04', 'L', 'Mahasiswa', 'Surabaya', '088888888889', 0, '2017-07-21'),
(53, 'Putri', '1997-01-01', 'P', 'Mahasiswa', 'Jawa Tengah', '0812121216868', 0, '2017-07-21'),
(54, 'Pinky', '1997-09-10', 'P', 'Mahasiswa', 'Surabaya', '0999999916', 0, '2017-07-21');
-- --------------------------------------------------------
--
-- Table structure for table `buku`
--
CREATE TABLE `buku` (
`id` int(5) NOT NULL,
`judul` varchar(50) NOT NULL,
`tahun` year(4) NOT NULL,
`status` tinyint(1) NOT NULL,
`penerbit` varchar(50) NOT NULL,
`penulis` varchar(50) NOT NULL,
`harga` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `buku`
--
INSERT INTO `buku` (`id`, `judul`, `tahun`, `status`, `penerbit`, `penulis`, `harga`) VALUES
(1, 'Matahari', 2016, 1, 'Bentang', 'Tere-Liye', '65000'),
(2, 'Atlas Al-Qur\'an', 2009, 1, 'Mizan', 'Syauqi Abu Khalil', '219000'),
(3, 'Beyond The Inspiration', 2013, 1, 'Al-Fatih Press', 'Felix Siauw', '45000'),
(4, 'Allegiant', 2013, 1, 'Mizan Fantasi', 'Veronica Roth', '79000'),
(5, 'Beternak Lele', 1966, 0, 'Sinar Pustaka', 'Indra Wirjawan', '36000'),
(6, 'Negeri 5 Menara', 2011, 1, 'Bentang', 'Ahmad Fuadi', '59000'),
(7, 'HIVE 1 : Higher Institute of Villaineous Education', 2014, 0, 'Mizan Fantasi', 'Mark Walden', '0'),
(8, 'Dunia Tanpa Manusia', 2008, 1, 'Gramedia', 'Alan Weisman', '70000'),
(9, 'Anda Puas, Kami Ikhlas', 2007, 0, 'Gramedia', 'Ari Z. Nanto', '40000'),
(10, 'Sherlock Holmes', 2003, 0, 'Indo Literasi', 'Sir Arthur Conan Doyle', '170000'),
(11, '100 Tip Pemula Untuk Microsoft Office', 2014, 1, 'Elex Computindo', 'Tim Ems', '30000'),
(12, 'Maybird and The After Ever', 2005, 0, 'Gramedia Pustaka Utama', 'Jody Lynn Anderson', '42000'),
(13, 'The Inferno', 2011, 1, 'Bentang Pustaka', 'Dan Brown', '0'),
(14, 'Statistik Nonparametrik', 1997, 0, 'Gramedia', 'Singgih Sant', '0'),
(15, 'Hujan Matahari', 2012, 1, 'Langit Langit Press', 'Kurniawan Gunadi', '0'),
(16, 'Ketika Anton Bertasbih', 2011, 1, 'Andi Press', 'Yayank ', '0'),
(17, 'Hujan', 2015, 1, 'Bentang', 'Tere-Liye', '0'),
(18, 'Kewirausahaan dan Manajemen Usaha Kecil', 2010, 1, 'Salemba Empat', 'Thomas W. Zimmer', '0'),
(19, 'Frea', 2012, 1, 'Divapress', 'Thee & Rien', '0'),
(20, 'The Maze Runner', 2014, 1, 'Gramedia Pustaka Utama', 'Sandy', '0'),
(21, 'The Lord of the Rings', 1997, 1, 'Bentang Pustaka', 'JJ Tolkiens', '200000'),
(22, 'Insurgent', 2013, 0, 'Mizan Fantasi', 'Veronica Roth', '0'),
(23, 'Jurus Ampuh Hadapi Susah Tidur', 2014, 1, 'Gramedia Pustaka Utama', 'Gunawan', '35000'),
(24, 'Hujan Kenangan', 2007, 1, 'Bentang Pustaka', 'Shelly Aprilia', '0'),
(25, 'Rindu', 2009, 0, 'Erlangga', 'Tere Liye', '26000'),
(26, 'Tentang Kamu', 2016, 0, 'Gramedia', 'Tere Liye', '40000'),
(27, '30 Paspor di Kelas Sang Professor', 2011, 0, 'Ikhlas Media', 'Js Khairen', '60000'),
(28, 'NINEVELOPE', 2016, 0, 'Pustaka Buku', 'Js Khairen', '90000'),
(29, 'Senja, Hujan dan Cerita yang Telah Usai', 2016, 0, 'Gramedia', 'Boy Candra', '75000'),
(30, 'Setelah Hujan Reda', 2015, 0, 'Pustaka Ilmu', 'Boy Candra', '70000'),
(31, 'Sebuah Usaha Melupakan', 2013, 0, 'Gramedia', 'Boy Candra', '50000'),
(32, 'Sang Pemimpi', 2008, 0, 'Gramedia', 'Andrea Hirata', '80000'),
(33, 'Laskar Pelangi', 2007, 0, 'Gramedia', 'Dee Lestari', '50000'),
(34, '5 cm', 2014, 0, 'Pustaka Buku', 'Donny Dhirgantoro', '45000'),
(35, 'Critical Eleven', 2015, 0, 'Gramedia', 'Ika Natassa', '65000'),
(36, 'Pulang', 2016, 0, 'Pustaka Ilmu', 'Tere Liye', '30000'),
(37, 'Hafalan Shalat Delisa', 2008, 0, 'Gramedia', 'Tere Liye', '45000'),
(38, 'Robohnya Surau Kami', 2003, 0, 'Balai Pustaka', 'A.A Navis', '45000'),
(39, 'Endesor', 2012, 0, 'Pustaka Zahra', 'Andrea Hirata', '50000'),
(40, 'Ayat-ayat Cinta', 2011, 0, 'Balai Pustaka', ' Habiburrahman El-Shirazy ', '70000'),
(41, 'Supernova', 2010, 0, 'Gramedia', 'Dee Lestari', '45000'),
(42, 'Ketika Cinta Bertasbih', 2009, 0, 'Pustaka Ilmu', ' Habiburrahman El-Shirazy ', '70000'),
(43, 'Winter In Tokyo', 2008, 0, 'Balai Pustaka', 'Ilana Tan', '75000'),
(44, 'Sunshine Becomes You', 2015, 0, 'Gramedia', 'Ilana Tan', '4000'),
(45, 'Ranah 3 Warna', 2009, 0, 'Balai Pustaka', 'A. Fuadi', '65000'),
(46, 'Siti Nurbaya', 2005, 0, 'Gramedia', 'Marah Rusli', '60000'),
(47, 'Bumi', 2013, 1, 'Gramedia', 'Tere Liye', '75000'),
(48, 'Anak Rantau', 2017, 0, 'Falcon Publishing', 'A. Fuadi', '72000'),
(49, 'Sayap-sayap Patah', 2017, 0, 'Bentang Pustaka', 'Kahlil Gibran', '64000'),
(50, 'Angan Senja dan Senyum Pagi', 2017, 0, 'Erlangga', 'Fahd Pahdepie', '63000'),
(51, 'Setelah Hujan Reda', 2000, 0, 'Erlangga', 'Boy Candra', '50000'),
(52, 'Mahasiswa', 2001, 0, 'Pustaka Ilmu', 'A.A. Navis', '45000'),
(53, 'Buku PT', 2015, 0, 'Pustaka Ilmu', 'A.Fuadi', '50000'),
(54, 'Kalbu', 2000, 0, 'Pustaka', 'Triyana', '4000'),
(55, 'Kampus', 2001, 0, 'Erlangga Pustaka', 'Fuad', '45000'),
(56, 'Kaos', 2017, 0, 'Pustaka', 'Fuad', '50000');
-- --------------------------------------------------------
--
-- Table structure for table `denda`
--
CREATE TABLE `denda` (
`no_transaksi` int(10) NOT NULL,
`id_buku` int(5) NOT NULL,
`id_anggota` int(5) NOT NULL,
`jenis_denda` tinyint(2) NOT NULL,
`biaya` int(10) NOT NULL,
`bayar` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `denda`
--
INSERT INTO `denda` (`no_transaksi`, `id_buku`, `id_anggota`, `jenis_denda`, `biaya`, `bayar`) VALUES
(1, 4, 3, 0, 10000, 10000),
(2, 6, 4, 0, 5000, 5000),
(3, 6, 2, 1, 59000, 59000),
(4, 4, 5, 1, 79000, 79000),
(5, 7, 2, 1, 50000, 50000),
(6, 13, 5, 1, 50000, 50000),
(7, 23, 13, 1, 35000, 35000),
(8, 5, 4, 0, 25000, 25000),
(9, 3, 1, 0, 20000, 20000),
(10, 10, 8, 0, 25000, 2500),
(11, 6, 7, 0, 25000, 0),
(12, 2, 1, 1, 219000, 0),
(13, 13, 8, 0, 710000, 0),
(14, 4, 4, 0, 705000, 705000),
(15, 12, 3, 0, 870000, 0),
(16, 19, 8, 0, 865000, 0),
(17, 16, 3, 0, 870000, 0),
(18, 13, 8, 0, 865000, 0),
(19, 12, 3, 0, 905000, 0),
(20, 1, 14, 1, 65000, 65000),
(21, 10, 11, 1, 170000, 170000),
(23, 5, 10, 1, 36000, 36000);
-- --------------------------------------------------------
--
-- Table structure for table `donasi`
--
CREATE TABLE `donasi` (
`no_transaksi` int(10) NOT NULL,
`tgl_donasi` date NOT NULL,
`id_buku` int(5) NOT NULL,
`id_anggota` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `donasi`
--
INSERT INTO `donasi` (`no_transaksi`, `tgl_donasi`, `id_buku`, `id_anggota`) VALUES
(1, '2016-12-03', 7, 1),
(2, '2016-12-08', 12, 7),
(3, '2016-12-09', 13, 5),
(4, '2016-12-12', 14, 3),
(5, '2016-12-16', 15, 1),
(6, '2016-12-16', 16, 1),
(7, '2016-12-16', 17, 7),
(8, '2016-12-16', 18, 2),
(9, '2016-12-20', 19, 5),
(10, '2016-12-23', 20, 4),
(11, '2016-12-23', 22, 1),
(12, '2016-12-23', 24, 8);
-- --------------------------------------------------------
--
-- Table structure for table `peminjaman`
--
CREATE TABLE `peminjaman` (
`no_transaksi` int(10) NOT NULL,
`tgl_pinjam` date NOT NULL,
`id_buku` int(5) NOT NULL,
`id_anggota` int(5) NOT NULL,
`tgl_kembali` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `peminjaman`
--
INSERT INTO `peminjaman` (`no_transaksi`, `tgl_pinjam`, `id_buku`, `id_anggota`, `tgl_kembali`) VALUES
(1, '2016-11-27', 2, 1, '2017-06-07'),
(2, '2016-11-27', 1, 2, '2017-06-08'),
(3, '2016-11-27', 3, 4, '2016-12-06'),
(4, '2016-11-28', 5, 3, '2016-12-01'),
(5, '2016-11-28', 4, 3, '2016-12-13'),
(6, '2016-11-28', 6, 4, '2016-12-13'),
(7, '2016-11-30', 7, 5, '2016-12-01'),
(8, '2016-12-01', 1, 6, '2016-12-14'),
(9, '2016-12-07', 3, 4, '2016-12-12'),
(10, '2016-12-07', 6, 2, '2016-12-10'),
(11, '2016-12-08', 2, 5, '2016-12-15'),
(12, '2016-12-09', 4, 5, '2016-12-21'),
(13, '2016-12-09', 8, 5, '2016-12-12'),
(14, '2016-12-15', 7, 6, '2016-12-20'),
(15, '2016-12-15', 5, 4, '2017-01-03'),
(16, '2016-12-15', 6, 7, '2017-01-03'),
(17, '2016-12-15', 10, 8, '2017-01-03'),
(18, '2016-12-16', 3, 1, '2017-01-03'),
(19, '2016-12-23', 1, 1, '2016-12-23'),
(20, '2016-12-23', 7, 2, '2016-12-23'),
(21, '2016-12-23', 13, 5, '2016-12-23'),
(22, '2016-12-23', 21, 12, '2017-01-03'),
(23, '2016-12-23', 23, 13, '2016-12-23'),
(24, '2017-01-02', 15, 0, NULL),
(25, '2017-01-02', 0, 0, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `peminjaman_detail`
--
CREATE TABLE `peminjaman_detail` (
`no_transaksi` int(10) NOT NULL,
`id_buku` int(5) NOT NULL,
`tgl_kembali` date DEFAULT NULL,
`id` int(12) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `peminjaman_detail`
--
INSERT INTO `peminjaman_detail` (`no_transaksi`, `id_buku`, `tgl_kembali`, `id`) VALUES
(1, 12, '2017-07-16', 1),
(1, 20, '2017-07-09', 2),
(1, 16, '2017-07-09', 3),
(2, 19, '2017-07-09', 4),
(2, 13, '2017-07-09', 5),
(3, 1, '2017-07-08', 6),
(3, 4, '2017-06-08', 7),
(4, 4, '2017-07-09', 8),
(4, 1, '2017-07-16', 9),
(4, 7, '2017-07-09', 10),
(5, 11, '2017-07-21', 11),
(5, 5, '2017-07-21', 12),
(6, 22, '2017-07-21', 13),
(7, 10, '2017-07-16', 14),
(9, 24, NULL, 15),
(10, 17, NULL, 16),
(11, 6, NULL, 17),
(11, 18, NULL, 18),
(11, 23, NULL, 19),
(12, 21, NULL, 21),
(13, 2, NULL, 22),
(14, 3, NULL, 23),
(14, 15, NULL, 24),
(16, 8, NULL, 25),
(17, 11, NULL, 26),
(18, 1, NULL, 27);
-- --------------------------------------------------------
--
-- Table structure for table `peminjaman_master`
--
CREATE TABLE `peminjaman_master` (
`no_transaksi` int(10) NOT NULL,
`tgl_pinjam` date NOT NULL,
`id_anggota` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `peminjaman_master`
--
INSERT INTO `peminjaman_master` (`no_transaksi`, `tgl_pinjam`, `id_anggota`) VALUES
(1, '2017-07-02', 3),
(2, '2017-07-03', 8),
(3, '2017-07-04', 4),
(4, '2017-07-08', 14),
(5, '2017-07-09', 10),
(6, '2017-07-09', 5),
(7, '2017-07-09', 11),
(8, '2017-07-14', 7),
(9, '2017-07-14', 7),
(10, '2017-07-14', 13),
(11, '2017-07-14', 1),
(12, '2017-07-14', 9),
(13, '2017-07-14', 2),
(14, '2017-07-15', 15),
(15, '2017-07-21', 52),
(16, '2017-07-21', 40),
(17, '2017-07-21', 2),
(18, '2017-07-21', 37);
-- --------------------------------------------------------
--
-- Table structure for table `peminjaman_master_peminjaman_detail`
--
CREATE TABLE `peminjaman_master_peminjaman_detail` (
`PeminjamanMasterModel_no_transaksi` int(11) NOT NULL,
`peminjamanDetailModels_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pengembalian`
--
CREATE TABLE `pengembalian` (
`no_transaksi` int(10) NOT NULL,
`tgl_kembali` date NOT NULL,
`tgl_pengembalian` date NOT NULL,
`status` int(4) NOT NULL DEFAULT '0',
`id_buku` int(5) NOT NULL,
`judul` varchar(50) NOT NULL,
`id_anggota` int(5) NOT NULL,
`nama` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sequence`
--
CREATE TABLE `sequence` (
`SEQ_NAME` varchar(50) NOT NULL,
`SEQ_COUNT` decimal(38,0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `sequence`
--
INSERT INTO `sequence` (`SEQ_NAME`, `SEQ_COUNT`) VALUES
('SEQ_GEN', '400');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`user_id` varchar(20) NOT NULL,
`user_pwd` varchar(32) NOT NULL,
`level` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `user_pwd`, `level`) VALUES
('admin', '1', 1),
('user', 'user', 3);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `anggota`
--
ALTER TABLE `anggota`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `buku`
--
ALTER TABLE `buku`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `denda`
--
ALTER TABLE `denda`
ADD PRIMARY KEY (`no_transaksi`),
ADD KEY `id_anggota` (`id_anggota`),
ADD KEY `id_buku` (`id_buku`);
--
-- Indexes for table `donasi`
--
ALTER TABLE `donasi`
ADD PRIMARY KEY (`no_transaksi`);
--
-- Indexes for table `peminjaman`
--
ALTER TABLE `peminjaman`
ADD PRIMARY KEY (`no_transaksi`);
--
-- Indexes for table `peminjaman_detail`
--
ALTER TABLE `peminjaman_detail`
ADD PRIMARY KEY (`id`),
ADD KEY `id_buku` (`id_buku`),
ADD KEY `no_transaksi` (`no_transaksi`) USING BTREE;
--
-- Indexes for table `peminjaman_master`
--
ALTER TABLE `peminjaman_master`
ADD PRIMARY KEY (`no_transaksi`),
ADD KEY `id_anggota` (`id_anggota`);
--
-- Indexes for table `peminjaman_master_peminjaman_detail`
--
ALTER TABLE `peminjaman_master_peminjaman_detail`
ADD PRIMARY KEY (`PeminjamanMasterModel_no_transaksi`,`peminjamanDetailModels_id`),
ADD KEY `pmnjmanmasterpeminjamandetailpmnjmanDetailModelsid` (`peminjamanDetailModels_id`);
--
-- Indexes for table `pengembalian`
--
ALTER TABLE `pengembalian`
ADD PRIMARY KEY (`no_transaksi`);
--
-- Indexes for table `sequence`
--
ALTER TABLE `sequence`
ADD PRIMARY KEY (`SEQ_NAME`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `anggota`
--
ALTER TABLE `anggota`
MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55;
--
-- AUTO_INCREMENT for table `buku`
--
ALTER TABLE `buku`
MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57;
--
-- AUTO_INCREMENT for table `denda`
--
ALTER TABLE `denda`
MODIFY `no_transaksi` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `donasi`
--
ALTER TABLE `donasi`
MODIFY `no_transaksi` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `peminjaman`
--
ALTER TABLE `peminjaman`
MODIFY `no_transaksi` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `peminjaman_detail`
--
ALTER TABLE `peminjaman_detail`
MODIFY `id` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `peminjaman_master`
--
ALTER TABLE `peminjaman_master`
MODIFY `no_transaksi` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `pengembalian`
--
ALTER TABLE `pengembalian`
MODIFY `no_transaksi` int(10) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `denda`
--
ALTER TABLE `denda`
ADD CONSTRAINT `denda_ibfk_1` FOREIGN KEY (`id_buku`) REFERENCES `buku` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `denda_ibfk_2` FOREIGN KEY (`id_anggota`) REFERENCES `anggota` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `peminjaman_detail`
--
ALTER TABLE `peminjaman_detail`
ADD CONSTRAINT `peminjaman_detail_ibfk_1` FOREIGN KEY (`id_buku`) REFERENCES `buku` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `peminjaman_detail_ibfk_2` FOREIGN KEY (`no_transaksi`) REFERENCES `peminjaman_master` (`no_transaksi`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `peminjaman_master`
--
ALTER TABLE `peminjaman_master`
ADD CONSTRAINT `peminjaman_master_ibfk_1` FOREIGN KEY (`id_anggota`) REFERENCES `anggota` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `peminjaman_master_peminjaman_detail`
--
ALTER TABLE `peminjaman_master_peminjaman_detail`
ADD CONSTRAINT `pmnjmanmasterpeminjamandetailpmnjmanDetailModelsid` FOREIGN KEY (`peminjamanDetailModels_id`) REFERENCES `peminjaman_detail` (`id`),
ADD CONSTRAINT `pmnjmnmstrpminjamandetailPmnjmnMstrMdelnotransaksi` FOREIGN KEY (`PeminjamanMasterModel_no_transaksi`) REFERENCES `peminjaman_master` (`no_transaksi`);
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment