Exam Open Question part (covers databases & SQL): 10 points
Consider a relational sales database related to a business information system – or part of it.
Primary keys are indicated with PK and foreign keys with FK. The relational model for the sales
database is given by:
Some comments:
• Your queries should not be dependent on specific content of the database, instead
they should work for the general case.
• The relationship between XSALE and XITEM, should be read as many-to-1 in Crow’s
foot notation.
• Data types are not given but can be logically inferred. If it is necessary, you can assume
a certain data type for a variable.
• Use aliases (like a, b, c, etc.) where possible
• It is allowed to make use of temporary tables, e.g. #table_X.
• Use SQL statements as: select, join, where, group by, having, order by, etc.
-1-
Consider a relational sales database related to a business information system – or part of it.
Primary keys are indicated with PK and foreign keys with FK. The relational model for the sales
database is given by:
Some comments:
• Your queries should not be dependent on specific content of the database, instead
they should work for the general case.
• The relationship between XSALE and XITEM, should be read as many-to-1 in Crow’s
foot notation.
• Data types are not given but can be logically inferred. If it is necessary, you can assume
a certain data type for a variable.
• Use aliases (like a, b, c, etc.) where possible
• It is allowed to make use of temporary tables, e.g. #table_X.
• Use SQL statements as: select, join, where, group by, having, order by, etc.
-1-