- 1

sql

There are many wolves in the zoo: black wolf, white wolf, lucky wolf, little wolf. They all have 'wolf' at the end of their names. Print the ages of all of the wolves. SELECT age FROM zoo WHERE animal LIKE ' '

28th Dec 2017, 2:42 PM
PRASANTH R
PRASANTH R - avatar
3 Respostas
+ 6
This probably came from the tutorials? Now that I look at it, I have a different database design in mind. We're supposed to have a "zoo" entity, a "animal" entity, the "animal_name" and "animal_age" being attributes of the "animal" entity, instead of placing them in "zoo". Then the statement would be something like: SELECT animal_age FROM animal WHERE animal_name LIKE '%wolf';
28th Dec 2017, 4:12 PM
Hatsy Rei
Hatsy Rei - avatar
+ 4
Where did you see this? SELECT age FROM zoo WHERE animal LIKE '%wolf'
28th Dec 2017, 3:43 PM
Ipang
+ 1
%wolf
23rd Sep 2018, 4:58 AM
Md. Abdullah Al Rafiul Hasan
Md. Abdullah Al Rafiul Hasan - avatar