Repository navigation
Expand file tree
/
Copy pathschema.sql
More file actions
42 lines (42 loc) · 3.62 KB
/
Copy pathschema.sql
File metadata and controls
42 lines (42 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE Administrateur(ID_administrateur integer primary key autoincrement,Nom varchar(255) NOT NULL,Email varchar(255) NOT NULL,Mot_de_passe varchar(255) NOT NULL);
INSERT INTO Administrateur VALUES(1,'Ali','ali@gmail.com','aliAdmin1');
CREATE TABLE Article(ID_article integer primary key autoincrement,Contenu varchar(255) NOT NULL,Date_publication dete NOT NULL,ID_administrateur integer,FOREIGN KEY (ID_administrateur) REFERENCES Administrateur(ID_administrateur));
INSERT INTO Article VALUES(1,'SQLite est un système de gestion de base de données relationnelle.','2024-04-30',1);
INSERT INTO Article VALUES(2,'La prochaine version de Java améliorera les performances, la stabilité et la sécurité du développement des applications Java.','2025-04-10',1);
INSERT INTO Article VALUES(3,'Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation','2025-04-10',1);
INSERT INTO Article VALUES(4,'XML is a software- and hardware-independent tool for storing and transporting data.','2025-04-10',1);
INSERT INTO Article VALUES(5,'PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.','2025-04-10',1);
CREATE TABLE Categorie(ID_Categorie integer primary key autoincrement,Nom varchar(255) NOT NULL,ID_article integer,FOREIGN KEY(ID_article) REFERENCES Article(ID_article));
INSERT INTO Categorie VALUES(1,'php',5);
INSERT INTO Categorie VALUES(2,'java',2);
INSERT INTO Categorie VALUES(3,'Sql',1);
INSERT INTO Categorie VALUES(4,'xml',4);
INSERT INTO Categorie VALUES(5,'Python',3);
CREATE TABLE SousCategorie(ID_Sous_Categorie integer primary key autoincrement,Nom varchar(255) NOT NULL,ID_Categorie integer,FOREIGN KEY(ID_Categorie) REFERENCES Categorie(ID_Categorie));
INSERT INTO SousCategorie VALUES(1,'langage simple',5);
INSERT INTO SousCategorie VALUES(2,'difficile',2);
INSERT INTO SousCategorie VALUES(3,'plus difficile',4);
INSERT INTO SousCategorie VALUES(4,'plus simple',3);
INSERT INTO SousCategorie VALUES(5,'débutants',1);
CREATE TABLE Utilisateur(ID_utilisateur integer primary key autoincrement,Nom varchar(255) NOT NULL,Email varchar(255) NOT NULL,mot_de_passe varchar(255) NOT NULL);
INSERT INTO Utilisateur VALUES(1,'amin','amin@gmail.com','amin12@èefr');
INSERT INTO Utilisateur VALUES(2,'yassin','yassin@gmail.com','yassin44f&2');
INSERT INTO Utilisateur VALUES(3,'kamal','kamal@gmail.com','kamalin44f&');
INSERT INTO Utilisateur VALUES(4,'hasna','hasna@gmail.com','hasnalin4');
INSERT INTO Utilisateur VALUES(5,'salwa','salwa@gmail.com','salwa6\@h');
CREATE TABLE Commentaire(id INTEGER PRIMARY KEY AUTOINCREMENT,contenu TEXT,Date DATE,ID_article INTEGER,ID_utilisateur INTEGER,ID_administrateur INTEGER,FOREIGN KEY(ID_article) REFERENCES Article(ID_article),FOREIGN KEY(ID_utilisateur) REFERENCES Utilisateur(ID_utilisateur),FOREIGN KEY(ID_administrateur) REFERENCES Administrateur(ID_administrateur));
INSERT INTO Commentaire VALUES(1,'Merci',2005,1,1,NULL);
INSERT INTO Commentaire VALUES(2,'Article très utile',2010,1,2,NULL);
INSERT INTO Commentaire VALUES(3,'Article très utile',2010,5,NULL,1);
INSERT INTO Commentaire VALUES(4,'Très agréable',2010,5,NULL,1);
INSERT INTO Commentaire VALUES(5,'Merci',2005,1,NULL,1);
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('Administrateur',1);
INSERT INTO sqlite_sequence VALUES('Article',5);
INSERT INTO sqlite_sequence VALUES('Categorie',5);
INSERT INTO sqlite_sequence VALUES('SousCategorie',5);
INSERT INTO sqlite_sequence VALUES('Utilisateur',5);
INSERT INTO sqlite_sequence VALUES('Commentaire',5);
COMMIT;