Skip to content

Usage of Any DBs #2

@bitfishxyz

Description

@bitfishxyz

Depend on MySQL 8.0 、 PostgreSQL 11.0

data types

Attributes of any data types:

  • How many bytes ?
  • Is it signed ?
  • Can it be NULL ?
  • Can it be changed ?
  • Auto increase ?

default attributes

MySQL PostgreSQL
UNSIGNED、can be NULL 、can be changed ---

Declaration of data types

MySQL

  • Integer
    • Bit(n) : n bits
    • TINYINT: 1 btye
    • SMALLINT: 2 bytes
    • MEDIUMINT: 3 bytes
    • INT: 4 bytes
    • BIGINT: 8 bytes
  • No-Integer
    • DECIMAL(m,n):store a number with (m-n)-max-length integer part and n-max-length pointed part.
  • String
    • CHAR(n): fixed-width, using this if data's length is stable
    • VARCHAR(n): use one byte or two bytes to store length, using this if data's length is not stable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions