Spaces:
Build error
Build error
Demosthene-OR
commited on
Commit
•
bc87a74
1
Parent(s):
ac92789
Update script.sql
Browse files- script.sql +15 -11
script.sql
CHANGED
@@ -2,19 +2,23 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
|
|
2 |
FLUSH PRIVILEGES;
|
3 |
|
4 |
SELECT VERSION();
|
5 |
-
-- Étape 1 :
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
11 |
);
|
12 |
|
13 |
-
-- Étape 2 :
|
14 |
-
INSERT INTO
|
15 |
-
VALUES ('
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-- Étape 3 : Sélectionner et afficher le contenu de la table
|
20 |
SELECT * FROM utilisateurs;
|
|
|
|
2 |
FLUSH PRIVILEGES;
|
3 |
|
4 |
SELECT VERSION();
|
5 |
+
-- Étape 1 : Création de la table User avec les champs FirstName, LastName, Email, Authorization, username et password
|
6 |
+
USE rakuten_db;
|
7 |
+
CREATE TABLE Users (
|
8 |
+
FirstName VARCHAR(30),
|
9 |
+
LastName VARCHAR(30),
|
10 |
+
Email VARCHAR(30),
|
11 |
+
Authorization INT,
|
12 |
+
username VARCHAR(30),
|
13 |
+
password VARCHAR(128) -- 128 caractères pour stocker le hachage bcrypt
|
14 |
);
|
15 |
|
16 |
+
-- Étape 2 : Insertion d'un utilisateur pour tester
|
17 |
+
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('Olivier', 'Renouard', 'olivier.renouard1103@gmail.com', 2, 'Olivier', '$2b$12$FWFmGn05f245f637.i9uYOdVEcDD2sC7ZO0cC0ePOjtY/OB6pOp0q');
|
18 |
+
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('Fadimatou', 'Abdoulaye', 'afadimatou@gmail.com', 2, 'Fadimatou' , '$2b$12$66yNO9XAmZj2vMbYu.icRueNRVJK/cTWvoSE3czHt/P5BlKSFBdyu');
|
19 |
+
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('John', 'Doe', 'john.doe@example.com', 1, 'John', '$2b$12$pfyjoh3RWS9crj8lFwF3ROWeSZ26Eu5m1WknmMJ0RqCYp.AHiu.MO');
|
20 |
+
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('Alice', 'Sapritch', 'alice.sapritch@example.com', 0, 'Alice', '$2b$12$vxWf8VtgaKDrCJmSkY/XUuwm7Fkqqu6W6BLvtfpymVAoR4mq7xrKq');
|
21 |
|
22 |
-- Étape 3 : Sélectionner et afficher le contenu de la table
|
23 |
SELECT * FROM utilisateurs;
|
24 |
+
|