Class diagram x Database

Asked

Viewed 92 times

0

I have a class diagram and would like to know how to build the database. Follow the scenario:

  • With the classes below I have a Demand that has a requester and an analyst, right next to each of the classes I must have a list of demands?

  • In this case as would the database, requester id and analysts id would be PK in their tables and fk in the DEMANDS table?

  • and in the case of the list of demands in Requesters and Analysts as would be in the BD, what kind of data?

Requester

- ID_SOLICITANTE
- NOME
- LOTACAO
- DEMANDAS (LIST)

Analyst

- ID_ANALISTA
- NOME
- EQUIPE
- DEMANDAS (LIST)

Demands

ID_DEMANDA
NRO_TICKET
PRIORIDADE
ANALISTA (Tipo: Analista)
SOLICITANTE (Tipo: Solicitante)
  • And what is the database manager: Oracle Database? Mysql? Sql Server? etc.

  • Postgresql eh o sgdb.

1 answer

1

With the classes below I have a Demand that has a requester and an analyst, right next to each of the classes I must have a list of demands?

I don’t quite understand this question, but if you want to know how to use it in a language object you have chosen, you should create a class Analista and Solicitante and have a variable of type Analista and Solicitante in class Demanda

In this case as would the database, requester id and analysts id would be PK in their tables and fk in the DEMANDS table?

Yes, as you determine the PK you can also determine the FK, there are several ways to do this. One way is:

...
id_solicitante int NOT NULL,
...
FOREIGN KEY (id_solicitante) REFERENCES solicitante (id_solicitante),

and in the case of the list of demands in Requesters and Analysts as would be in the BD, what kind of data?

The same in the table where it is PK (usually int or bigint), but not auto_increment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.