-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `oliveiradasilvat_bibliomaniak`
--
CREATE DATABASE IF NOT EXISTS `oliveiradasilvat_bibliomaniak` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `oliveiradasilvat_bibliomaniak`;

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

--
-- Table structure for table `t_livre`
--

CREATE TABLE IF NOT EXISTS `t_livre` (
  `PK_Livre` int(11) NOT NULL AUTO_INCREMENT,
  `Title` text NOT NULL,
  `Author` text NOT NULL,
  `FK_Genre` int(11) NOT NULL,
  `FK_Login` int(11) NOT NULL,
  PRIMARY KEY (`PK_Livre`),
  KEY `FK_Genre` (`FK_Genre`),
  KEY `FK_Login` (`FK_Login`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `t_livre`
--

INSERT INTO `t_livre` (`PK_Livre`, `Title`, `Author`, `FK_Genre`, `FK_Login`) VALUES
(1, 'Docteur Sleep', 'Stephen King', 2,1),
(2, 'Godefroy de Bouillon', 'Pierre Aubé', 8,1),
(3, 'Eragon', 'Christopher Paolini', 4,1),
(4, 'Baudouin IV de Jérusalem', 'Pierre Aubé', 8,1),
(5, 'Alexis Ier Comnène', 'Elisabeth Malamut', 8,1),
(6, 'Les croisades vues par les Arabes', 'Amin Maalouf', 8,1),
(7, 'Les Assassins', 'Bernard Lewis', 8,1),
(8, 'Des Turcs', 'George de Hongrie', 8,1);

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

--
-- Table structure for table `t_genre`
--

CREATE TABLE IF NOT EXISTS `t_genre` (
  `PK_Genre` int(11) NOT NULL AUTO_INCREMENT,
  `Nom` text NOT NULL,
  PRIMARY KEY (`PK_Genre`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `t_genre`
--

INSERT INTO `t_genre` (`PK_Genre`, `Nom`) VALUES
(1, 'Thriller'),
(2, 'Horreur'),
(3, 'Amour'),
(4, 'Fantastique'),
(5, 'Action'),
(6, 'Policier'),
(7, 'SF'),
(8, 'Historique');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `t_livre`
--
ALTER TABLE `t_livre`
  ADD CONSTRAINT `t_livre_ibfk_1` FOREIGN KEY (`FK_Genre`) REFERENCES `t_genre` (`PK_Genre`),
  ADD CONSTRAINT `t_livre_ibfk_2` FOREIGN KEY (`FK_Login`) REFERENCES `t_login` (`PK_Login`);
  COMMIT;

