-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 27, 2023 at 02:12 PM
-- Server version: 5.7.36-0ubuntu0.18.04.1
-- PHP Version: 7.4.29

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

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

--
-- Table structure for table `Book`
--

CREATE TABLE `Book` (
  `id` int(11) NOT NULL,
  `pIdAuthor` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `nrOfPages` int(11) NOT NULL,
  `abstract` text NOT NULL,
  `hasHardCover` tinyint(1) NOT NULL DEFAULT '0',
  `genreIdSet` varchar(255) NOT NULL,
  `verlagId` int(11) NOT NULL,
  `pathFileNameCover` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Book`
--

INSERT INTO `Book` (`id`, `pIdAuthor`, `title`, `nrOfPages`, `abstract`, `hasHardCover`, `genreIdSet`, `verlagId`, `pathFileNameCover`) VALUES
(1, 1, 'Don Quixote', 500, 'Ein <strong>verrueckter</strong> Dude wird zum selbsternannten Ritter', 0, '', 0, ''),
(3, 3, 'The Da Vinci Code', 700, '', 0, '', 0, ''),
(4, 2, 'The Hobbit', 200, '', 0, '', 0, ''),
(5, 2, 'The Lord of the Rings', 100, '<p>The <em>precious</em> was stolen</p>', 1, '2,4', 6, 'fileadmin/protected/book_covers/5_clipboard-202206281657-8pnxe.png');

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

--
-- Table structure for table `Ggroup`
--

CREATE TABLE `Grp` (
  `id` int(11) NOT NULL,
  `grId` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `reference` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Ggroup`
--

INSERT INTO `Grp` (`id`, `grId`, `name`, `reference`) VALUES
(1, 0, 'Genre', 'library_genre'),
(2, 1, 'Fantasy', 'library_genre_fantasy'),
(3, 1, 'Thriller', 'library_genre_thriller'),
(4, 1, 'Novel', 'library_genre_novel'),
(5, 0, 'Verlag', 'library_verlag'),
(6, 5, 'Pingu Verlag', 'library_verlag_pingu'),
(7, 0, 'Role Librarian', 'library_role_librarian');

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

--
-- Table structure for table `GroupMember`
--

CREATE TABLE `Glue` (
  `id` int(11) NOT NULL,
  `grId` int(11) NOT NULL,
  `xId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `GroupMember`
--

INSERT INTO `Glue` (`id`, `grId`, `xId`) VALUES
(1, 6, 1),
(2, 2, 1),
(3, 3, 4),
(4, 4, 5),
(5, 2, 5);

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

--
-- Table structure for table `Person`
--

CREATE TABLE `Person` (
  `id` int(11) NOT NULL,
  `firstName` varchar(255) NOT NULL,
  `lastName` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `account` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Person`
--

INSERT INTO `Person` (`id`, `firstName`, `lastName`, `email`, `account`) VALUES
(1, 'Miguel', 'de Cervantes', 'migu@cervi.ch', 'migu@cervi.ch'),
(2, 'J. R. R.', 'Tolkien', 'j.r.r.tolkien@goat.ch', 'tolk'),
(3, 'Dan', 'Brown', 'dani.brown@bluewin.ch', 'dani');

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

--
-- Table structure for table `Rental`
--

CREATE TABLE `Rental` (
  `id` int(11) NOT NULL,
  `bookId` int(11) NOT NULL,
  `pId` int(11) NOT NULL,
  `start` datetime NOT NULL,
  `end` datetime NOT NULL,
  `returned` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Rental`
--

INSERT INTO `Rental` (`id`, `bookId`, `pId`, `start`, `end`, `returned`) VALUES
(1, 1, 3, '2022-07-01 00:00:00', '2022-08-20 00:00:00', '2022-07-28 15:27:00'),
(2, 1, 2, '2022-07-01 00:00:00', '2022-11-24 00:00:00', '0000-00-00 00:00:00'),
(4, 4, 2, '2022-06-09 00:00:00', '2022-06-30 00:00:00', '2022-06-29 12:00:00'),
(6, 5, 3, '2022-07-25 00:00:00', '2022-08-25 00:00:00', '0000-00-00 00:00:00'),
(7, 1, 2, '2022-02-17 00:00:00', '2022-03-17 00:00:00', '2022-04-23 10:30:00');

--
-- Indexes for dumped tables
--

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

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `Book`
--
ALTER TABLE `Book`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `Ggroup`
--
ALTER TABLE `Grp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `GroupMember`
--
ALTER TABLE `Glue`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

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

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