-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
37 lines (32 loc) · 1.37 KB
/
init.sql
File metadata and controls
37 lines (32 loc) · 1.37 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
USE mysql; -- definito in compose.yaml
-- Tabelle di esempio
CREATE TABLE prodotti (
id INT PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(255),
descrizione TEXT,
rilascio DATE
);
CREATE TABLE utenti (
id INT PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(255),
pass_word VARCHAR(255), -- per evitare ambiguità con la keyword "password"
email VARCHAR(255),
registrazione DATE
);
-- Inserimento dati di esempio
INSERT INTO prodotti (nome, descrizione, rilascio) VALUES
('prodotto1', 'Descrizione sicura', '2023-01-15'),
('prodotto2', 'Descrizione segreta', '2023-02-20'),
('prodotto3', 'Descrizione dettagliata del prodotto', '2023-03-10'),
('prodotto4', 'Prodotto ad alta richiesta', '2023-04-05'),
('prodotto5', 'Offerta speciale', '2023-05-25'),
('prodotto6', 'Prodotto esclusivo', '2023-06-18'),
('prodotto7', 'Prodotto in edizione limitata', '2023-07-30');
INSERT INTO utenti (nome, pass_word, email, registrazione) VALUES
('utente1', 'qwerty123', 'utente1@example.com', '2023-01-10'),
('utente2', '123456789', 'utente2@example.com', '2023-02-15'),
('utente3', 'password123', 'utente3@example.com', '2023-03-20'),
('utente4', 'securepass', 'utente4@example.com', '2023-04-25'),
('utente5', 'abc12345', 'utente5@example.com', '2023-05-30'),
('utente6', 'password!@#', 'utente6@example.com', '2023-06-05'),
('utente7', 'letmein', 'utente7@example.com', '2023-07-10');