I bring in a record database. And for some reason they are not recorded in order. And the output from the database is not in order. I did the sorting by ID for correct output, but still interesting.

Table structure
Table structure

Entries in the table
table entries .

    1 answer 1

    According to the theory of relational databases, there is no default order in the tables. The order is set by sorting in the output (query) to the table. If sorting is not specified, the order of output is determined by the primary key.

    • one
      >> If sorting is not specified, the order of output is determined by the primary key. If sorting is not specified, then the order of output is at the discretion of the DBMS. Yes, sometimes it may coincide with the primary key. - KoVadim
    • @KoVadim - agree - Barmaley