Skip to content

Overview

Suppliers and Parts

Some examples for the individual operations available in Bmg use a version of the well-known Suppliers and Parts database. It contains the following four relations:

cities
citycountry
LondonEngland
ParisFrance
AthensGreece
BrusselsBelgium
parts
pidnamecolorweightcity
P1NutRed12.0London
P2BoltGreen17.0Paris
P3ScrewBlue17.0Oslo
P4ScrewRed14.0London
P5CamBlue12.0Paris
P6CogRed19.0London
suppliers
sidnamestatuscity
S1Smith20London
S2Jones10Paris
S3Blake30Paris
S4Clark20London
S5Adams30Athens
supplies
sidpidqty
S1P1300
S1P2200
S1P3400
S1P4200
S1P5100
S1P6100
S2P1300
S2P2400
S3P2200
S4P2200
S4P4300
S4P5400

Here’s are some examples to illustrate what the relations represent:

  • Supplier S1 (Smith) supplies 6 different parts
  • There are 2 types of screw, one which weighs 17.0 and the other 14.0 (grams, let’s say)
  • There are 2 suppliers in London, 2 in Paris, and 1 in Athens
  • Supplier S4 (Clark) has 900 parts in stock, in total
  • For the part P5 (Cam), there are 500 items in stock in total, accross all suppliers

Our examples assume the four relations are referenced by variables by the same names: cities, parts, etc.

Get part numbers for all parts supplied by more than one supplier