A brief note on SELECT, WHERE and ORDER BY: the parts of a query, the comparison operators, text and Boolean values, sorting, and how to work out the output, with practice, a program and questions to check yourself.
A brief note on SELECT, WHERE and ORDER BY. Read it before a test. Try each question at the end before you open its answer.
SELECT the fields to output, with commas between them, in the order you want.FROM the table.WHERE a condition (optional): only the records for which it is true.ORDER BY a field ASC or DESC (optional).=, <> (not equal to), >, <, >=, <=.WHERE Town = 'Hillview'.WHERE Age > 14.WHERE Paid = TRUE.>=, "more than" is >.WHERE are sorted.ORDER BY.SELECT order.The program builds a small table and runs a query with WHERE and ORDER BY.
> for "at least". It leaves out the value itself.SELECT, FROM, WHERE, ORDER BY.Town field equal to Lakeside.ORDER BY Age ASC: or ?WHERE Age > 15. Is a member aged output?ORDER BY, SELECT, WHERE, FROM.Log in to join the discussion.
Loading…