# data[].attributes.attachment_link.readable_text
-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               9.0.0 - MySQL Community Server - GPL
-- Server OS:                    Win64
-- HeidiSQL Version:             12.7.0.6850
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


-- Dumping database structure for quanlythuvien
CREATE DATABASE IF NOT EXISTS `quanlythuvien` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `quanlythuvien`;

-- Dumping structure for table quanlythuvien.muontra
CREATE TABLE IF NOT EXISTS `muontra` (
  `MaMuonTra` int NOT NULL AUTO_INCREMENT,
  `MaSach` int DEFAULT NULL,
  `MaThanhVien` int DEFAULT NULL,
  `NgayMuon` date DEFAULT NULL,
  `HanTra` date DEFAULT NULL,
  `NgayTra` date DEFAULT NULL,
  PRIMARY KEY (`MaMuonTra`),
  KEY `MaSach` (`MaSach`),
  KEY `MaThanhVien` (`MaThanhVien`),
  CONSTRAINT `muontra_ibfk_1` FOREIGN KEY (`MaSach`) REFERENCES `sach` (`MaSach`),
  CONSTRAINT `muontra_ibfk_2` FOREIGN KEY (`MaThanhVien`) REFERENCES `thanhvien` (`MaThanhVien`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_vietnamese_ci;

-- Dumping data for table quanlythuvien.muontra: ~0 rows (approximately)
DELETE FROM `muontra`;
INSERT INTO `muontra` (`MaMuonTra`, `MaSach`, `MaThanhVien`, `NgayMuon`, `HanTra`, `NgayTra`) VALUES
	(1, 1, 1, '2024-03-01', '2024-03-15', '2024-03-12'),
	(2, 2, 2, '2024-02-20', '2024-03-05', NULL),
	(3, 3, 3, '2024-01-15', '2024-01-30', '2024-02-01'),
	(4, 4, 4, '2024-03-10', '2024-03-25', NULL),
	(5, 5, 5, '2024-02-28', '2024-03-14', '2024-03-13'),
	(6, 1, 1, '2024-02-10', '2024-02-25', '2024-03-01'),
	(7, 2, 2, '2024-01-15', '2024-01-30', '2024-02-05'),
	(8, 3, 3, '2024-03-05', '2024-03-20', '2024-03-25'),
	(9, 4, 4, '2024-02-01', '2024-02-15', '2024-02-20'),
	(10, 5, 5, '2024-01-10', '2024-01-25', '2024-01-30'),
	(11, 6, 6, '2024-03-10', '2024-03-25', NULL),
	(12, 7, 7, '2024-02-15', '2024-03-02', NULL),
	(13, 8, 8, '2024-01-20', '2024-02-05', NULL),
	(14, 9, 9, '2024-03-01', '2024-03-16', NULL),
	(15, 10, 10, '2024-02-05', '2024-02-20', NULL);

-- Dumping structure for table quanlythuvien.sach
CREATE TABLE IF NOT EXISTS `sach` (
  `MaSach` int NOT NULL AUTO_INCREMENT,
  `TieuDe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci NOT NULL,
  `TacGia` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci NOT NULL,
  `NhaXuatBan` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci DEFAULT NULL,
  `NamXuatBan` int DEFAULT NULL,
  `MaTheLoai` int DEFAULT NULL,
  `SoLuong` int DEFAULT '1',
  PRIMARY KEY (`MaSach`),
  KEY `MaTheLoai` (`MaTheLoai`),
  CONSTRAINT `sach_ibfk_1` FOREIGN KEY (`MaTheLoai`) REFERENCES `theloaisach` (`MaTheLoai`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_vietnamese_ci;

-- Dumping data for table quanlythuvien.sach: ~0 rows (approximately)
DELETE FROM `sach`;
INSERT INTO `sach` (`MaSach`, `TieuDe`, `TacGia`, `NhaXuatBan`, `NamXuatBan`, `MaTheLoai`, `SoLuong`) VALUES
	(1, 'M���t Bi���c', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 1990, 3, 5),
	(2, 'C�� G��i �����n T��� H��m Qua', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 1989, 3, 5),
	(3, 'T��i Th���y Hoa V��ng Tr��n C��� Xanh', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 2010, 3, 7),
	(4, 'Ch�� B�� R���c R���i', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 1997, 3, 4),
	(5, 'H��� �����', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 2000, 3, 6),
	(6, 'B���y B�����c T���i M��a H��', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 2012, 3, 8),
	(7, '��i Qua Hoa C��c', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 1995, 3, 5),
	(8, 'Cho T��i Xin M���t V�� ��i Tu���i Th��', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 2008, 3, 10),
	(9, 'L�� N���m Trong L��', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 2011, 3, 5),
	(10, 'Ng���i Kh��c Tr��n C��y', 'Nguy���n Nh���t ��nh', 'NXB Tr���', 2013, 3, 7),
	(11, '�����c Nh��n T��m', 'Dale Carnegie', 'NXB Tr���', 2019, 1, 10),
	(12, 'Nh�� Gi��� Kim', 'Paulo Coelho', 'NXB H���i Nh�� V��n', 2018, 3, 7),
	(13, 'H��nh Tr��nh V��� Ph����ng ����ng', 'Baird T. Spalding', 'NXB V��n H���c', 2020, 2, 5),
	(14, 'Gi��o Tr��nh SQL', 'Nguy���n V��n A', 'NXB Gi��o D���c', 2022, 4, 15),
	(15, 'Cha Gi��u Cha Ngh��o', 'Robert Kiyosaki', 'NXB Tr���', 2021, 5, 8),
	(16, 'L���p Tr��nh C++ C�� B���n', 'Bjarne Stroustrup', 'NXB C��ng Ngh���', 2017, 4, 12),
	(17, 'L���p Tr��nh Python Cho Ng�����i M���i B���t �����u', 'Guido van Rossum', 'NXB C��ng Ngh���', 2018, 4, 9),
	(18, 'Tri���t H���c Ph����ng ����ng', 'L��o T���', 'NXB V��n H���c', 2005, 2, 6),
	(19, 'Kinh T��� H���c C��n B���n', 'Adam Smith', 'NXB Kinh T���', 2015, 5, 10),
	(20, 'L���ch S��� Chi���n Tranh Th��� Gi���i', 'John Keegan', 'NXB L���ch S���', 2000, 2, 8),
	(21, 'C���u Tr��c D��� Li���u & Gi���i Thu���t', 'Donald Knuth', 'NXB Khoa H���c', 2019, 4, 7),
	(22, 'Th��� Gi���i Ph���ng', 'Thomas Friedman', 'NXB Kinh T���', 2016, 5, 9),
	(23, 'T�� Duy Nhanh & Ch���m', 'Daniel Kahneman', 'NXB Kinh T���', 2013, 5, 11),
	(24, 'Sapiens: L�����c S��� Lo��i Ng�����i', 'Yuval Noah Harari', 'NXB V��n H���c', 2014, 2, 12),
	(25, 'L���p Tr��nh Java C��n B���n', 'James Gosling', 'NXB C��ng Ngh���', 2020, 4, 10),
	(26, 'Gi���i M�� Gen Ng�����i', 'Richard Dawkins', 'NXB Khoa H���c', 2011, 2, 6),
	(27, 'T��m L�� H���c ����m ����ng', 'Gustave Le Bon', 'NXB T��m L��', 2012, 3, 8),
	(28, 'L���ch S��� Th��� Gi���i C��� �����i', 'Herodotus', 'NXB L���ch S���', 1999, 2, 7),
	(29, 'Kinh T��� H���c V�� M��', 'Paul Krugman', 'NXB Kinh T���', 2018, 5, 9);

-- Dumping structure for table quanlythuvien.thanhvien
CREATE TABLE IF NOT EXISTS `thanhvien` (
  `MaThanhVien` int NOT NULL AUTO_INCREMENT,
  `HoTen` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci NOT NULL,
  `Email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci DEFAULT NULL,
  `SoDienThoai` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci DEFAULT NULL,
  `DiaChi` text CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci,
  `NgayThamGia` date DEFAULT NULL,
  PRIMARY KEY (`MaThanhVien`),
  UNIQUE KEY `Email` (`Email`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_vietnamese_ci;

-- Dumping data for table quanlythuvien.thanhvien: ~0 rows (approximately)
DELETE FROM `thanhvien`;
INSERT INTO `thanhvien` (`MaThanhVien`, `HoTen`, `Email`, `SoDienThoai`, `DiaChi`, `NgayThamGia`) VALUES
	(1, 'Nguy���n V��n An', 'an.nguyen@gmail.com', '0123456789', 'Qu���n 1, TP.HCM', '2023-05-12'),
	(2, 'Tr���n Th��� B��ch', 'bich.tran@yahoo.com', '0987654321', 'Qu���n Ph�� Nhu���n, TP.HCM', '2023-08-10'),
	(3, 'L�� Minh Ho��ng', 'hoang.le@gmail.com', '0912345678', 'Qu���n 7, TP.HCM', '2022-12-01'),
	(4, 'Ph���m H���ng Nhung', 'nhung.pham@hotmail.com', '0934567890', 'Qu���n B��nh Th���nh, TP.HCM', '2024-01-15'),
	(5, '����� Qu���c Tu���n', 'tuan.do@outlook.com', '0901234567', 'Qu���n 5, TP.HCM', '2023-09-20'),
	(6, 'Nguy���n Minh Tu���n', 'tuan.nguyen@gmail.com', '0987111222', 'Qu���n 3, TP.HCM', '2023-06-15'),
	(7, 'L�� Ho��ng Anh', 'hoanganh.le@gmail.com', '0978555444', 'Qu���n 10, TP.HCM', '2023-09-20'),
	(8, 'Tr���n V��n Nam', 'nam.tran@yahoo.com', '0905123123', 'Qu���n B��nh T��n, TP.HCM', '2023-12-05'),
	(9, 'Ph���m Th��� H���ng', 'hong.pham@gmail.com', '0912333444', 'Qu���n Ph�� Nhu���n, TP.HCM', '2022-05-10'),
	(10, 'Nguy���n �����c H���nh', 'hanh.nguyen@outlook.com', '0934555666', 'Qu���n Ph�� Nhu���n, TP.HCM', '2021-07-22'),
	(11, 'L�� Minh Khoa', 'khoa.ly@gmail.com', '0906777888', 'Qu���n Ph�� Nhu���n, TP.HCM', '2020-09-18'),
	(12, '��o��n Th��� Th��y', 'thuy.doan@hotmail.com', '0988999000', 'Qu���n Ph�� Nhu���n, TP.HCM', '2023-02-14'),
	(13, 'V�� Qu���c B���o', 'bao.vo@gmail.com', '0977666555', 'Qu���n Ph�� Nhu���n, TP.HCM', '2019-11-30');

-- Dumping structure for table quanlythuvien.theloaisach
CREATE TABLE IF NOT EXISTS `theloaisach` (
  `MaTheLoai` int NOT NULL AUTO_INCREMENT,
  `TenTheLoai` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci NOT NULL,
  `MoTa` text CHARACTER SET utf8mb4 COLLATE utf8mb4_vietnamese_ci,
  PRIMARY KEY (`MaTheLoai`),
  UNIQUE KEY `TenTheLoai` (`TenTheLoai`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_vietnamese_ci;

-- Dumping data for table quanlythuvien.theloaisach: ~5 rows (approximately)
DELETE FROM `theloaisach`;
INSERT INTO `theloaisach` (`MaTheLoai`, `TenTheLoai`, `MoTa`) VALUES
	(1, 'V��n h���c', 'S��ch thu���c th��� lo���i v��n h���c'),
	(2, 'Khoa h���c', 'S��ch v��� khoa h���c v�� nghi��n c���u'),
	(3, 'L���ch s���', 'S��ch l���ch s��� Vi���t Nam v�� th��� gi���i'),
	(4, 'C��ng ngh���', 'S��ch v��� c��ng ngh���, l���p tr��nh'),
	(5, 'Thi���u nhi', 'S��ch d��nh cho tr��� em');

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
