3

For example, I know what SELECT * FROM example_table; means. However, I feel uncomfortable not knowing what each part of the code means.

2

3 Answers 3

5

The second part of a SQL query is the name of the column you want to retrieve for each record you are getting.

You can obviously retrieve multiple columns for each record, and (only if you want to retrieve all the columns) you can replace the list of them with *, which means "all columns".

So, in a SELECT statement, writing * is the same of listing all the columns the entity has.

Here you can find probably the best tutorial for SQL learning.

2

I am providing you answer by seperating each part of code.

SELECT == It orders the computer to include or select each content from the database name(table ) .

(*) == means all {till here code means include all from the database.}

FROM == It refers from where we have to select the data.

example_table == This is the name of the database from where we have to select data.

the overall meaning is :

include all data from the databse whose name is example_table.

thanks.

1

For a beginner knowing the follower concepts can be really useful,

SELECT refers to attributes that you want to have displayed in your final query result. There are different 'SELECT' statements such as 'SELECT DISTINCT' which returns only unique values (if there were duplicate values in the original query result)

FROM basically means from which table you want the data. There can be one or many tables listed under the 'FROM' statement.

WHERE means the condition you want to satisfy. You can also do things like ordering the list by using 'order by DESC' (no point using order by ASC as SQL orders values in ascending order after you use the order by clause). Refer to W3schools for a better understanding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.