0
I am starting in SQL language. I have the following error:
Table 'linces.controlos' doesn't exist
I haven’t found the solution yet, someone can help?
Drop Database if Exists Linces;
Create Database Linces;
Use Linces;
Create Table Linces(
Id_lince int NOT NULL,
Nome_lince char(50),
Genero char(50),
Data_obito datetime,
Id_pai int NOT NULL,
Id_mae int NOT NULL,
Primary Key (Id_lince)
);
Create Table Localizacoes(
Id_lince int NOT NULL,
Datahora datetime NOT NULL,
latitude double,
longitude double,
Constraint pk_Localizacoes Primary Key (Id_lince, Datahora),
Constraint ch_estr_Id_lince
Foreign Key (Id_lince)
References Linces (Id_lince)
On Update Cascade
On Delete Cascade
);
Create Table Tecnicos(
Id_func int NOT NULL,
Nome_func char(50) Not Null,
Primary Key (Id_func)
);
Create Table Controlos(
Id_lince int NOT NULL,
Dat datetime NOT NULL,
Id_func int Not Null,
Peso double,
Estado_saude char(50) Not Null,
Constraint pk_Controlos Primary Key (Id_lince, dat, Id_func),
Constraint ch_estr_Id_lince
Foreign Key (Id_lince)
References Linces (Id_lince)
On Update Cascade
On Delete Set Null,
Constraint ch_estr_Id_func
Foreign Key (Id_func)
References Tecnicos (Id_func)
On Update Cascade
On Delete Cascade
);
At what point did the error occur?
– Roknauta