-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestdql.sql
178 lines (141 loc) · 4.75 KB
/
testdql.sql
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : mer. 27 oct. 2021 à 10:44
-- Version du serveur : 10.4.21-MariaDB
-- Version de PHP : 7.4.25
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 : `testdql`
--
-- --------------------------------------------------------
--
-- Structure de la table `classroom`
--
CREATE TABLE `classroom` (
`id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `classroom`
--
INSERT INTO `classroom` (`id`, `name`) VALUES
(1, '1A10'),
(2, '1A21');
-- --------------------------------------------------------
--
-- Structure de la table `club`
--
CREATE TABLE `club` (
`ref` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`creation_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Structure de la table `doctrine_migration_versions`
--
CREATE TABLE `doctrine_migration_versions` (
`version` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
`executed_at` datetime DEFAULT NULL,
`execution_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Déchargement des données de la table `doctrine_migration_versions`
--
INSERT INTO `doctrine_migration_versions` (`version`, `executed_at`, `execution_time`) VALUES
('DoctrineMigrations\\Version20211024150049', '2021-10-24 18:13:37', 348),
('DoctrineMigrations\\Version20211024173524', '2021-10-24 19:35:28', 38),
('DoctrineMigrations\\Version20211024173702', '2021-10-24 19:37:05', 35);
-- --------------------------------------------------------
--
-- Structure de la table `student`
--
CREATE TABLE `student` (
`nsc` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`creation_date` datetime NOT NULL,
`date_of_birth` datetime NOT NULL,
`enabled` tinyint(1) NOT NULL,
`classroom_id` int(11) NOT NULL,
`moyenne` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `student`
--
INSERT INTO `student` (`nsc`, `email`, `creation_date`, `date_of_birth`, `enabled`, `classroom_id`, `moyenne`) VALUES
('1', 'aziz.270700@gmail.com', '2016-07-27 03:04:00', '2021-07-01 04:25:00', 1, 1, 0),
('2', 'mohamed@esprit.tn', '2016-01-01 00:00:00', '2016-01-01 00:00:00', 0, 1, 0),
('4', 'eya', '2016-01-01 00:00:00', '2016-01-01 00:00:00', 0, 1, 12);
-- --------------------------------------------------------
--
-- Structure de la table `students_clubs`
--
CREATE TABLE `students_clubs` (
`student_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`club_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `classroom`
--
ALTER TABLE `classroom`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `club`
--
ALTER TABLE `club`
ADD PRIMARY KEY (`ref`);
--
-- Index pour la table `doctrine_migration_versions`
--
ALTER TABLE `doctrine_migration_versions`
ADD PRIMARY KEY (`version`);
--
-- Index pour la table `student`
--
ALTER TABLE `student`
ADD PRIMARY KEY (`nsc`),
ADD KEY `IDX_B723AF336278D5A8` (`classroom_id`);
--
-- Index pour la table `students_clubs`
--
ALTER TABLE `students_clubs`
ADD PRIMARY KEY (`student_id`,`club_id`),
ADD KEY `IDX_A9AE56D7CB944F1A` (`student_id`),
ADD KEY `IDX_A9AE56D761190A32` (`club_id`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `classroom`
--
ALTER TABLE `classroom`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `student`
--
ALTER TABLE `student`
ADD CONSTRAINT `FK_B723AF336278D5A8` FOREIGN KEY (`classroom_id`) REFERENCES `classroom` (`id`);
--
-- Contraintes pour la table `students_clubs`
--
ALTER TABLE `students_clubs`
ADD CONSTRAINT `FK_A9AE56D761190A32` FOREIGN KEY (`club_id`) REFERENCES `club` (`ref`),
ADD CONSTRAINT `FK_A9AE56D7CB944F1A` FOREIGN KEY (`student_id`) REFERENCES `student` (`nsc`);
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 */;