Home > Mobile >  Is SELECT * clear enough to specify which query we are referring to?
Is SELECT * clear enough to specify which query we are referring to?

Time:10-16

I am new to mySQL. I am following Mosh's tutorial to familiarize myself to SQL.

Here's my question for the following code.

SELECT *
FROM order_items
WHERE order_id = 6 AND unit_price*quantity > 30

When I looked up about SELECT *, it says: * means to return all all columns of the queried tables. Then I think SELECT * means that it grabs all tables from all schema. My question is: Isn't it a bit inefficient and confusing to return all column provided my understanding is right? If the database become bigger and bigger, it will consume unnecessary effort to look up the keyword, so I think SELECT should specify what table it is referring to. Thanks for reading!

  • Related