If I have two queries
SELECT Id, Forename, Surname
FROM Person
WHERE PersonName Like(‘%frank%’)
And
SELECT *
FROM Person
WH
This is the correct way and the most optimal. The reason is that your only gathering the data needed so it takes up the correct space (What you need) in storing the data before you get your results.
SELECT Id, Forename, Surname
FROM Person
WHERE PersonName Like(‘%frank%’)
This is incorrect as it takes up unused fields which takes up more space to run your query which slows down your results. Even if you get lucky and use all the fields in your query it's best to list them individually. This will clarify the query and what data is to be returned to any other developer who might need to modify the query in the future.
SELECT *
FROM Person
WHERE PersonName Like(‘%frank%’)