--
-- Host: localhost    Database: domsanwe_domsan
-- ------------------------------------------------------


--
-- Table structure for table `transaksi`
--

CREATE TABLE `transaksi` (
  `id_transaksi` int(11) NOT NULL AUTO_INCREMENT,
  `id_siswa` int(11) DEFAULT NULL,
  `tanggal` date DEFAULT NULL,
  `keterangan` varchar(225) DEFAULT NULL,
  `kode_tr` int(11) DEFAULT NULL,
  `nominal` int(11) DEFAULT NULL,
  `saldo_Awal` int(11) DEFAULT NULL,
  `saldo_akhir` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_transaksi`),
  KEY `transaksi_ibfk_1` (`id_siswa`),
  CONSTRAINT `transaksi_ibfk_1` FOREIGN KEY (`id_siswa`) REFERENCES `user` (`id_siswa`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transaksi`
--

INSERT INTO `transaksi` VALUES (50,97,'2025-06-19','Jajan',1,10000,0,10000),(51,97,'2025-07-29','-',1,500000000,10000,500010000);

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `id_siswa` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(100) NOT NULL,
  `no_induk` int(11) DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `saldo` decimal(15,2) DEFAULT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(225) DEFAULT NULL,
  `role` enum('1','2','3') DEFAULT NULL,
  `kelas` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_siswa`),
  UNIQUE KEY `no_induk` (`no_induk`)
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user`
--

INSERT INTO `user` VALUES (92,'Aulia Fatmawati',NULL,NULL,0.00,'admin1','admin','1',NULL),(93,'Aulia Fatmawati',NULL,NULL,0.00,'teller','teller','3',NULL),(97,'RIZKA SYARIFATUL MAULIDA',9876,'',500010000.00,'rizkasyarifatulmaulida','9876','2',11),(100,'Dita',NULL,NULL,0.00,'dita','12345678','3',NULL);

--
-- Temporary table structure for view `view_transaksi`
--

/*!50001 DROP VIEW IF EXISTS `view_transaksi`*/;
/*!50001 CREATE VIEW `view_transaksi` AS SELECT
 1 AS `id_siswa`,
  1 AS `id_transaksi`,
  1 AS `tanggal`,
  1 AS `kode_tr`,
  1 AS `nominal`,
  1 AS `saldo_awal`,
  1 AS `saldo_akhir`,
  1 AS `keterangan`,
  1 AS `nama`,
  1 AS `no_induk`,
  1 AS `foto`,
  1 AS `saldo`,
  1 AS `username`,
  1 AS `password`,
  1 AS `role`,
  1 AS `kelas` */;

--
-- Dumping events for database 'domsanwe_domsan'
--

--
-- Dumping routines for database 'domsanwe_domsan'
--

--
-- Final view structure for view `view_transaksi`
--

/*!50001 DROP VIEW IF EXISTS `view_transaksi`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`domsanwe_domsan`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `view_transaksi` AS select `transaksi`.`id_siswa` AS `id_siswa`,`transaksi`.`id_transaksi` AS `id_transaksi`,`transaksi`.`tanggal` AS `tanggal`,`transaksi`.`kode_tr` AS `kode_tr`,`transaksi`.`nominal` AS `nominal`,`transaksi`.`saldo_Awal` AS `saldo_awal`,`transaksi`.`saldo_akhir` AS `saldo_akhir`,`transaksi`.`keterangan` AS `keterangan`,`user`.`nama` AS `nama`,`user`.`no_induk` AS `no_induk`,`user`.`foto` AS `foto`,`user`.`saldo` AS `saldo`,`user`.`username` AS `username`,`user`.`password` AS `password`,`user`.`role` AS `role`,`user`.`kelas` AS `kelas` from (`transaksi` join `user` on(`transaksi`.`id_siswa` = `user`.`id_siswa`)) */;


