Class diagram x Database

0

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

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

  • In this case what would the database look like, id requestor and id analysts would be PK in your tables and fk in the table DEMANDS?

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

Applicant

- 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)
    
asked by anonymous 17.02.2018 / 21:56

1 answer

1

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

I do not quite understand this question, but if you want to know how to use it in an object of the language 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 what would the database look like, id requestor and id analysts would be PK in their tables and fk in the table DEMANDS?

Yes, just 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 DB, what type of data?

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

    
17.02.2018 / 22:36