Relational algebra - recode column values
Suppose I have a table 'animals' whose rows represent different animals and there is a column species that might have values like 'cat', 'dog', 'horse', 'cow' etc. Suppose I am only interested in whether the animal is a dog or not. In sql (at least in MySQL) I am able to make a query like select (species='dog') as isDog from animals to return 1 for dogs and 0 otherwise. How can I express this in RA? It is not selecting because we are not limiting rows. Can I use project operator even though my expression (species='dog') is not an attribute as such? Or how should I deal with this? EDIT: I want