why insert query is inserting data in random order?
SQL doesn’t guaranteed order in
INSERT, that’s a SELECT prerogative.
From a data model point of view the data is “table-like”, so there’s no real concept of “order” there, it’s all related to indexing.
Long story short: it’s a SELECT job to order, not really an INSERT
However different databases may implement this differently, so it depends on your DB of choice, mine is a “generalization”.
Thank you for the response.