Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Relationen bei table Erstellung

Empfohlene Antworten

Veröffentlicht

Hallo, ich erstelle eine kleine Datenbank und habe mit 2 Relationen ein Problem.

Es geht um 2 Entitäten:

(Customer=Name der Entität)

company_ID (PK) 1...1 (zu company_ID)

company_name

address

telephone

maincontact (FK) 0...1 (zu caller_ID)

(Caller)

1..1 caller_ID (PK)

1...* company_ID (FK)

first_name

last_name

Eine Company hat einen oder mehrere Caller. Sowie jede Company hat einen hauptcaller (maincontact), aber nicht jeder caller ist ein maincontact.

Stimmen dazu die Relationen und Primary Key und Foreign Key? Wenn das stimmt dann habe ich nämlich bei der table Erstellung Probleme, weil die beiden table gegenseitig auf sich verweisen.

danke für Antworten

Eventuell hilft es die Kontakte, die Hauptcaller sind, in eine extra Tabelle zu verlagern.

Dann mit Verweis auf die Caller-Tabelle.

danke, ich denke ich habs.

ich war mir unsicher ob die relationen stimmen, denn wenn es so stimmt dann war die table erstellung mir unbekannt. aber das kommt wohl häufiger vor. ich habe erst customer erstellt ohne FK bei maincontact und danach den anderen table und dann den fehlenden FK bei customer mit alter table geändert.

create table customer(

company_ID NUMBER(20) PRIMARY KEY,

company_name VARCHAR2(100),

address VARCHAR2(100),

telephone NUMBER(30),

maincontact NUMBER(10)

);

create table caller(

caller_ID NUMBER(20) PRIMARY KEY,

company_ID NUMBER(20) REFERENCES customer(company_ID),

first_name VARCHAR2(100),

last_name VARCHAR2(100)

);

alter table customer add constraint customerrefcaller_ID foreign key(maincontact) references caller(caller_ID);

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.