-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtech_train.sql
More file actions
295 lines (243 loc) · 9.18 KB
/
Copy pathtech_train.sql
File metadata and controls
295 lines (243 loc) · 9.18 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 28-Nov-2017 às 18:37
-- Versão do servidor: 10.1.25-MariaDB
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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 */;
--
-- Database: `tech_train`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `categorias`
--
CREATE TABLE `categorias` (
`idCategoria` int(11) NOT NULL,
`nmCategoria` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Extraindo dados da tabela `categorias`
--
INSERT INTO `categorias` (`idCategoria`, `nmCategoria`) VALUES
(1, 'INFORMÁTICA'),
(2, 'ADMINISTRAÇÃO'),
(3, 'ARTES');
-- --------------------------------------------------------
--
-- Estrutura da tabela `cursos`
--
CREATE TABLE `cursos` (
`idCurso` int(11) NOT NULL,
`idCategoria` int(11) NOT NULL,
`nmCurso` varchar(60) NOT NULL,
`infoCurso_Simples` varchar(20) NOT NULL,
`infoCurso_Extensa` longtext NOT NULL,
`dataCurso` date NOT NULL,
`imagCurso` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Extraindo dados da tabela `cursos`
--
INSERT INTO `cursos` (`idCurso`, `idCategoria`, `nmCurso`, `infoCurso_Simples`, `infoCurso_Extensa`, `dataCurso`, `imagCurso`) VALUES
(1, 1, 'PHP do basico ao avançado', 'Sistemas para Web', 'Se você está em dúvida sobre aprender a programar, ou qual linguagem aprender, neste curso algumas informações bem interessantes sobre PHP, bem como algumas vantagens e desvantagens da linguagem são trazidas. O usuário saberá também os conceitos da web inclusivo o que é o PHP, e importância desta linguagem de programação no mercado.', '2017-11-28', '/img/php_ba.jpg'),
(2, 2, 'ÉTICA EMPRESARIAL', 'Etica empresarial', 'A ética empresarial é o ramo da ética diretamente ligado às empresas, que é referente à conduta ética das empresas, ou seja, à forma moralmente correta com que as empresas interagem com o seu meio envolvente.', '2017-11-28', '/img/etica.jpg');
-- --------------------------------------------------------
--
-- Estrutura da tabela `faz_curso`
--
CREATE TABLE `faz_curso` (
`idFazCurso` int(11) NOT NULL,
`idUsuario` int(11) NOT NULL,
`idCurso` int(11) NOT NULL,
`dataInscricao` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estrutura da tabela `ministra_curso`
--
CREATE TABLE `ministra_curso` (
`idMiniCurso` int(11) NOT NULL,
`idProfessor` int(11) NOT NULL,
`idCurso` int(11) NOT NULL,
`cargaHorariaCurso` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Extraindo dados da tabela `ministra_curso`
--
INSERT INTO `ministra_curso` (`idMiniCurso`, `idProfessor`, `idCurso`, `cargaHorariaCurso`) VALUES
(1, 1, 1, '06:00:00'),
(2, 2, 2, '09:00:00');
-- --------------------------------------------------------
--
-- Estrutura da tabela `professor`
--
CREATE TABLE `professor` (
`idProfessor` int(11) NOT NULL,
`nmProfessor` varchar(60) NOT NULL,
`fotoProfessor` varchar(30) DEFAULT NULL,
`canalProfessor` varchar(100) NOT NULL,
`linkCanalProf` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Extraindo dados da tabela `professor`
--
INSERT INTO `professor` (`idProfessor`, `nmProfessor`, `fotoProfessor`, `canalProfessor`, `linkCanalProf`) VALUES
(1, 'João Rubens Filho', '/images/d.jpg', 'Professor Binho', 'https://www.youtube.com/channel/UCeLVLkSv831fCGFZmRaPnQQ'),
(2, ' Tiago', '/images/13.jpg', 'ÉTICA EMPRESARIAL', 'https://www.youtube.com/playlist?list=PLD6mqlYl8U15hJa8FbdhP6cxJYVXioWop');
-- --------------------------------------------------------
--
-- Estrutura da tabela `usuario`
--
CREATE TABLE `usuario` (
`idUsuario` int(11) NOT NULL,
`nmUsuario` varchar(100) NOT NULL,
`senhaUsuario` varchar(100) NOT NULL,
`emailUsuario` varchar(1000) CHARACTER SET utf32 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Extraindo dados da tabela `usuario`
--
INSERT INTO `usuario` (`idUsuario`, `nmUsuario`, `senhaUsuario`, `emailUsuario`) VALUES
(1, 'Admin', '12wGaKkN1hGuw', 'admin@email.com');
-- --------------------------------------------------------
--
-- Estrutura da tabela `video`
--
CREATE TABLE `video` (
`idVideo` int(11) NOT NULL,
`idCurso` int(11) NOT NULL,
`tituloVideo` varchar(50) NOT NULL,
`urlVideo` varchar(50) NOT NULL,
`descricaoVideo` text NOT NULL,
`duracaoVideo` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Extraindo dados da tabela `video`
--
INSERT INTO `video` (`idVideo`, `idCurso`, `tituloVideo`, `urlVideo`, `descricaoVideo`, `duracaoVideo`) VALUES
(1, 1, 'Vale a Pena aprender PHP?', 'https://www.youtube.com/watch?v=9HEcscFY_oI', 'Neste vídeo eu trago informações bem interessantes sobre PHP, bem como algumas vantagens e desvantagens da linguagem!', '00:07:56'),
(2, 1, 'Arrays em PHP - Introdução e princip', 'https://www.youtube.com/watch?v=qhLskEIxd2Q', 'Arrays em PHP são muito importantes para manipular dados. Neste vídeo, eu apresento alguns truques importantes com arrays, como diferenciar arrays associados e indexados, array_map, array_filter.', '00:14:00'),
(3, 1, 'Spaceship Operator - PHP 7', 'https://www.youtube.com/watch?v=dvB4SwjTbCg', 'Já ouviu falar no operador Spaceship? Então se liga neste exemplo que vou apresentar utilizando o spaceship. Vamos criar uma classe de cliente e uma classe que fornece um método de ordenação customizado para clientes!', '00:10:00'),
(4, 2, 'Ética - Negócios e Vida', 'https://www.youtube.com/watch?v=iij2DCvgELg&in', 'Ética - Negócios e Vida', '00:26:00'),
(5, 2, 'Introdução à TGA - Cap. 17', 'https://www.youtube.com/watch?v=i_9-9p-qFCU&in', 'Ética e responsabilidade das organizações', '00:10:00');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `categorias`
--
ALTER TABLE `categorias`
ADD PRIMARY KEY (`idCategoria`);
--
-- Indexes for table `cursos`
--
ALTER TABLE `cursos`
ADD PRIMARY KEY (`idCurso`),
ADD KEY `idCategoria` (`idCategoria`);
--
-- Indexes for table `faz_curso`
--
ALTER TABLE `faz_curso`
ADD PRIMARY KEY (`idFazCurso`),
ADD KEY `idUsuario` (`idUsuario`,`idCurso`),
ADD KEY `fc_ibfk_1` (`idCurso`);
--
-- Indexes for table `ministra_curso`
--
ALTER TABLE `ministra_curso`
ADD PRIMARY KEY (`idMiniCurso`),
ADD KEY `idProfessor` (`idProfessor`,`idCurso`),
ADD KEY `mc_ibfk_1` (`idCurso`);
--
-- Indexes for table `professor`
--
ALTER TABLE `professor`
ADD PRIMARY KEY (`idProfessor`);
--
-- Indexes for table `usuario`
--
ALTER TABLE `usuario`
ADD PRIMARY KEY (`idUsuario`);
--
-- Indexes for table `video`
--
ALTER TABLE `video`
ADD PRIMARY KEY (`idVideo`),
ADD KEY `idCurso` (`idCurso`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `categorias`
--
ALTER TABLE `categorias`
MODIFY `idCategoria` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `cursos`
--
ALTER TABLE `cursos`
MODIFY `idCurso` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `faz_curso`
--
ALTER TABLE `faz_curso`
MODIFY `idFazCurso` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ministra_curso`
--
ALTER TABLE `ministra_curso`
MODIFY `idMiniCurso` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `professor`
--
ALTER TABLE `professor`
MODIFY `idProfessor` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `usuario`
--
ALTER TABLE `usuario`
MODIFY `idUsuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `video`
--
ALTER TABLE `video`
MODIFY `idVideo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- Constraints for dumped tables
--
--
-- Limitadores para a tabela `cursos`
--
ALTER TABLE `cursos`
ADD CONSTRAINT `cursos_ibfk_1` FOREIGN KEY (`idCategoria`) REFERENCES `categorias` (`idCategoria`);
--
-- Limitadores para a tabela `faz_curso`
--
ALTER TABLE `faz_curso`
ADD CONSTRAINT `fc_ibfk_1` FOREIGN KEY (`idCurso`) REFERENCES `cursos` (`idCurso`),
ADD CONSTRAINT `fc_ibfk_2` FOREIGN KEY (`idUsuario`) REFERENCES `usuario` (`idUsuario`);
--
-- Limitadores para a tabela `ministra_curso`
--
ALTER TABLE `ministra_curso`
ADD CONSTRAINT `mc_ibfk_1` FOREIGN KEY (`idCurso`) REFERENCES `cursos` (`idCurso`),
ADD CONSTRAINT `mc_ibfk_2` FOREIGN KEY (`idProfessor`) REFERENCES `professor` (`idProfessor`);
--
-- Limitadores para a tabela `video`
--
ALTER TABLE `video`
ADD CONSTRAINT `video_ibfk_1` FOREIGN KEY (`idCurso`) REFERENCES `cursos` (`idCurso`);
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 */;