Exericse: Complete a database model for an ordering application

2020-11-07| YouTube explanation (German) | IHK final exam Winter 2003/2004, GH2 Exercise 4

One of your colleagues has started to design the database of an ordering application:

Diagram

// Note: an article can be purchased from any supplier for a different price.
Table article_group {
  id integer
  name char(255) [not null]
}

Table article {
  id integer
  description text
  retail_price decimal(8,2) [not null]
  in_stock integer
  __1 datatype
}

Table order {
  id integer
  ordered_at datetime [not null]
  __1 datatype
}

Table order_item { 
  id integer
  order_id integer
  __1 datatype
  __2 datatype
}

Table supplier {
  __1 datatype
  name char(255) [not null, unique]
  address text [not null]
}

Table __ {
  // Hint: this table must have its own internal id
  __1 datatype
  __2 datatype
  __3 datatype
  __4 datatype
}

Complete the schema by adding the relevant primary and foreign keys and missing table(s). Also note that an article can be purchased from any supplier for a different price.