2.3 The Cape-codd Schema

2.3.1 The diagram with 6.3

Cape-Codd Schema w/ MySQL data types (MySQL Workbench 6.3)

Cape-Codd Schema w/ MySQL data types (MySQL Workbench 6.3)

2.3.2 The diagram with 8.0

Cape-Codd Schema w/ MySQL data types (MySQL Workbench 8)

Cape-Codd Schema w/ MySQL data types (MySQL Workbench 8)

2.3.3 MySQL INT(n)

reference: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html

  • TINYINT(n) = 1 byte (8 bit)
  • SMALLINT(n) = 2 bytes (16 bit)
  • MEDIUMINT(n) = 3 bytes (24 bit)
  • INT(n) = 4 bytes (32 bit)
  • BIGINT(n) = 8 bytes (64 bit).

n is the display length.

Use the option unsigned for positive numbers and zeros.

2.3.4 MySQL DECIMAL

When declaring a DECIMAL or NUMERIC column in MySQL, the precision and scale can be specified; for example:

salary DECIMAL(5,2)

In this example, 5 is the precision and 2 is the scale.

  • The precision represents the number of significant digits that are stored for values, and
  • the scale represents the number of digits that can be stored following the decimal point.
  • If the scale is 0, DECIMAL and NUMERIC values contain no decimal point or fractional part.