teach-ict.com logo

THE education site for computer science and ICT

Answer: Question 19


For this table,

data table

The SQL statement is:

SELECT * FROM SchoolList WHERE School LIKE St% OR StudentNum < 100


This returns
KT108OP   St John Fisher School  A Amil   1200  (from the LIKE part)


CT43PQ   Dasher Academy  W Brown   60   ( from the OR StudentNum < 100 part)


So you can combine LIKE AND OR in any combination to form quite complicated queries.