· 8 years ago · Nov 29, 2017, 10:56 PM
1create database if not exists trabalho;
2use trabalho;
3create table Fornecedor (
4 id_fornecedor int not null,
5 nome char(50) not null,
6 telefone char(15) not null,
7 endereco char(150) not null,
8 primary key (id_fornecedor));
9
10create table Funcionário (
11 id_funcionario int not null,
12 nome char(50) not null,
13 cpf char(15) not null,
14 rg char(15) not null,
15 nascimento date not null,
16 endereco char(150) not null,
17 telefone char(15) not null,
18 primary key (id_funcionario));
19
20create table Garagem (
21 id_garagem int not null,
22 capacidade int not null,
23 primary key (id_garagem));
24
25create table Manutenção (
26 id_manutencao int not null,
27 data_manutencao date not null,
28 primary key (id_manutencao));
29
30create table Máquina (
31 id_maquina int not null,
32 tipo char(15) not null,
33 modelo char(15) not null,
34 horas_trabalhadas int not null,
35 cor char(15) not null,
36 ano date not null,
37 primary key (id_maquina));
38
39create table Oleo (
40 id_oleo int not null,
41 nome char(50) not null,
42 descrição char(100) not null,
43 horas_duracao int not null,
44 primary key (id_oleo));
45
46create table Peça (
47 id_peca int not null,
48 nome char(50) not null,
49 descrição char(100) not null,
50 tipo char(15) not null,
51 primary key (id_peca));
52
53create table Usuário (
54 login char(100) not null,
55 senha char(100) not null,
56 primary key (login));