

The group_id in the suppliers table is used for establishing the relationship between rows in the suppliers and supplier_groups tables.īefore inserting a row into the suppliers table, you have to look up an existing group_id in the supplier_groups table and use this value for insertion.Īssuming that the supplier_groups table contains the following data:įOREIGN KEY(group_id) REFERENCES supplier_groups(group_id) In other words, one supplier group has many suppliers while each supplier must belong to a supplier group. The relationship between supplier_groups and suppliers table is one-to-many. Each supplier must belong to a supplier group. The suppliers table stores the supplier information. Each supplier group may have zero, one, or many suppliers. The supplier_groups table stores supplier groups e.g., one-time supplier, third-party supplier, and inter-co supplier. Supplier_id NUMBER GENERATED BY DEFAULT AS IDENTITY,Ĭode language: SQL (Structured Query Language) ( sql )

Group_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
