Ad
  • Custom User Avatar

    If I am not wrong, this is the best practice because of the following reasons:

    1. It fetches only the required columns, reducing the amount of data transferred. By doing this, it also limits the possible exposure of sensitive data.
    2. SQL keywords should be consistently capitalized to improve readability.

    Maybe for this particular case, using '*' after the keyword 'SELECT' could lead to the same result, but I think it is good to develop the habit of just fetching the required columns by using their names and thus avoiding the possible fetching of unnecessary or sensible data.

  • Custom User Avatar

    Not the Best Practices definatly

  • Custom User Avatar

    In theory, yes. Bust in many cases the time saved by using a wildcard is more important. Plus, you can limit your sample to, let's say, 100 rows and not worry about how many columns you have there anymore.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution