Colonnes de la table
Nom Type Null Clé Défaut Extra
id_recette int(11) NO PRIMARY NULL auto_increment
nom varchar(255) NO - NULL -
description text NO - NULL -
temps_de_preparation int(11) NO - NULL -
temps_de_cuisson int(11) NO - NULL -
nombre_de_personnes int(11) NO - NULL -
difficulte int(11) NO - NULL -
image varchar(255) YES - NULL -
id_utilisateur int(11) NO INDEX NULL -
CREATE TABLE
CREATE TABLE `Recette` (
  `id_recette` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `temps_de_preparation` int(11) NOT NULL,
  `temps_de_cuisson` int(11) NOT NULL,
  `nombre_de_personnes` int(11) NOT NULL,
  `difficulte` int(11) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `id_utilisateur` int(11) NOT NULL,
  PRIMARY KEY (`id_recette`),
  KEY `id_utilisateur` (`id_utilisateur`),
  CONSTRAINT `Recette_ibfk_1` FOREIGN KEY (`id_utilisateur`) REFERENCES `Utilisateur` (`id_utilisateur`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
Aide rapide
Types de clés :
  • PRIMARY : Clé primaire (identifiant unique)
  • UNIQUE : Valeur unique dans la colonne
  • INDEX : Index pour accélérer les recherches
Exemples de requêtes :
  • SELECT * FROM Recette LIMIT 10;
  • SELECT COUNT(*) FROM Recette;
  • DESCRIBE Recette;