I have a table "usuario" (idUsuario, nome, departamentoId)
and another table "departamento" (idDepartamento, nome)
.
I would like to enter random data in the user table, but for this, I need to consider only the department IDs (FKs) that have already been entered.
I think it should be something like:
INSERT INTO usuario (idusuario, nome, departamentoId)
VALUES (seq_usuario.nextVal, 'nomealeatorio', FK_ALEATORIA_DEPARTAMENTO);
How do I generate this 'nomealeatorio' and get a department FK that already exists?