sql | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

sql

can anyone explain me this(in challenge 1 part 8) SELECT age FROM zoo WHERE animal LIKE ' '

6th Jan 2017, 7:55 PM
Vibhanshu Tyagi
Vibhanshu Tyagi - avatar
2 Answers
+ 1
You basically select all ages (each age as row) from zoo (witch is a table) where animal (is a other attribute like age) like '<what_you_want>'. So there are two basic placeholder: % is used for an unspecific amount of characters and _ is used for one single character. Example: SELECT age FROM zoo WHERE animal LIKE '_e%' This Query will return all ages in the table zoo, where our animal (e.g. varchar2) contains the letter 'e' at 2nd place and is as long as you want. (Zebra, etc.) In hope, I could help you!
6th Jan 2017, 11:22 PM
Felix Reichel
0
thanks a lot.really helped a lot in understanding of the concept
12th Jan 2017, 12:09 PM
Vibhanshu Tyagi
Vibhanshu Tyagi - avatar