sql process flow

how sql fetches data from database from query using sql server