I have table users with columns id, username, email and password.
And i have another table with relations to table users.
Some developers use prefix way (column id_user), some developers use postfix way (column user_id).
Which way is correct and why.
There is no correct way, it’s just a matter of taste. I’d use the prefix over the postfix because it puts the more meaningful part of the name first, making it slightly faster to read (or so I imagine).