Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- phpMyAdmin SQL Dump
- -- version 5.1.0
- -- https://www.phpmyadmin.net/
- --
- -- Hôte : localhost
- -- Généré le : sam. 15 mai 2021 à 14:30
- -- Version du serveur : 8.0.25
- -- Version de PHP : 8.0.3
- 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 */;
- --
- -- Base de données : `pfa`
- --
- -- --------------------------------------------------------
- --
- -- Structure de la table `abonne`
- --
- CREATE TABLE `abonne` (
- `num_abonne` int NOT NULL,
- `nom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `prenom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `naissance` datetime NOT NULL,
- `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `pays` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `ville` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `login` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `pass` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- -- --------------------------------------------------------
- --
- -- Structure de la table `bon_commande`
- --
- CREATE TABLE `bon_commande` (
- `num_boncommande` int NOT NULL,
- `date_boncommande` datetime NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- -- --------------------------------------------------------
- --
- -- Structure de la table `bon_livraison`
- --
- CREATE TABLE `bon_livraison` (
- `num_bonlivraison` int NOT NULL,
- `date_bonlivraison` datetime NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- -- --------------------------------------------------------
- --
- -- Structure de la table `client`
- --
- CREATE TABLE `client` (
- `num_client` int NOT NULL,
- `nom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `prenom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `telephone` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
- `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `adresse` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
- `ville` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- -- --------------------------------------------------------
- --
- -- Structure de la table `facturation`
- --
- CREATE TABLE `facturation` (
- `num_facturation` int NOT NULL,
- `id_poisson` int NOT NULL,
- `qte_facturee` int NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- -- --------------------------------------------------------
- --
- -- Structure de la table `facture`
- --
- CREATE TABLE `facture` (
- `num_fact` int NOT NULL,
- `date` datetime NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- -- --------------------------------------------------------
- --
- -- Structure de la table `poisson`
- --
- CREATE TABLE `poisson` (
- `id_poisson` int NOT NULL,
- `prix` double NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- --
- -- Index pour les tables déchargées
- --
- --
- -- Index pour la table `abonne`
- --
- ALTER TABLE `abonne`
- ADD PRIMARY KEY (`num_abonne`);
- --
- -- Index pour la table `bon_commande`
- --
- ALTER TABLE `bon_commande`
- ADD PRIMARY KEY (`num_boncommande`);
- --
- -- Index pour la table `bon_livraison`
- --
- ALTER TABLE `bon_livraison`
- ADD PRIMARY KEY (`num_bonlivraison`);
- --
- -- Index pour la table `client`
- --
- ALTER TABLE `client`
- ADD PRIMARY KEY (`num_client`);
- --
- -- Index pour la table `facturation`
- --
- ALTER TABLE `facturation`
- ADD PRIMARY KEY (`num_facturation`,`id_poisson`),
- ADD KEY `fk_poisson` (`id_poisson`);
- --
- -- Index pour la table `facture`
- --
- ALTER TABLE `facture`
- ADD PRIMARY KEY (`num_fact`);
- --
- -- Index pour la table `poisson`
- --
- ALTER TABLE `poisson`
- ADD PRIMARY KEY (`id_poisson`);
- --
- -- AUTO_INCREMENT pour les tables déchargées
- --
- --
- -- AUTO_INCREMENT pour la table `abonne`
- --
- ALTER TABLE `abonne`
- MODIFY `num_abonne` int NOT NULL AUTO_INCREMENT;
- --
- -- AUTO_INCREMENT pour la table `bon_commande`
- --
- ALTER TABLE `bon_commande`
- MODIFY `num_boncommande` int NOT NULL AUTO_INCREMENT;
- --
- -- AUTO_INCREMENT pour la table `bon_livraison`
- --
- ALTER TABLE `bon_livraison`
- MODIFY `num_bonlivraison` int NOT NULL AUTO_INCREMENT;
- --
- -- AUTO_INCREMENT pour la table `client`
- --
- ALTER TABLE `client`
- MODIFY `num_client` int NOT NULL AUTO_INCREMENT;
- --
- -- AUTO_INCREMENT pour la table `facture`
- --
- ALTER TABLE `facture`
- MODIFY `num_fact` int NOT NULL AUTO_INCREMENT;
- --
- -- AUTO_INCREMENT pour la table `poisson`
- --
- ALTER TABLE `poisson`
- MODIFY `id_poisson` int NOT NULL AUTO_INCREMENT;
- --
- -- Contraintes pour les tables déchargées
- --
- --
- -- Contraintes pour la table `facturation`
- --
- ALTER TABLE `facturation`
- ADD CONSTRAINT `fk_facturation` FOREIGN KEY (`num_facturation`) REFERENCES `facture` (`num_fact`) ON DELETE CASCADE ON UPDATE RESTRICT,
- ADD CONSTRAINT `fk_poisson` FOREIGN KEY (`id_poisson`) REFERENCES `poisson` (`id_poisson`) ON DELETE CASCADE ON UPDATE RESTRICT;
- 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 */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement