PDA

View Full Version : [Database Design] Avere una tabella N:M che abbia anche una


MaxDembo81
18-08-2017, 19:08
Le mie tabelle sono le seguenti

Installazione
id

Gruppo
Gruppo_id
installazione_id

Interfaccia
Interfaccia_id
Servizio_id

Servizi
servizio_id
Installazione_id

gruppi_interfaccia
gruppo_id
interfaccia_id
servizio_id


io vorrei che nella tabella N:M gruppi interfaccia non si possano inserire record dove il gruppo faccia riferimento a una installazione e l'interfaccia ad esso associata faccia riferimento ad un'altra installazione.


Facciamo un esempio coi valori

Installazione:
I1
I2

Gruppi:
G1 I1
G2 I1

Servizi
S1 I1
S2 I2

Interfaccia
B1 S1
B2 S2

gruppi_interfaccia
G1 B1
G2 B2 errato!


Non so se mi sono spiegato bene, se ś come posso risolvere?

PS: a dire la verità la relazione fra servizi e installazioni sarebbe N:M :D

Hardware Upgrade Forum Database Error
Database Error Database error
The Hardware Upgrade Forum database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.hwupgrade.it home page, then try to open another page.
  • Click the Back button to try another link.
The www.hwupgrade.it forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.