Abstract. Relational algebra is one of the main topics covered in undergraduate computer science database courses. In this paper, we present a web-based tool designed to automatically correct relational algebra queries. The tool is integrated in a more general e-learning environment and is used to reinforce teaching and learning on introductory database courses. A teacher enters relational algebra problems into the system and it generates personalized workbooks with different relational algebra exercises for each student. Students solve these exercises using a specifically designed interface. They enter relational algebra expressions to solve the assigned queries and the system provides immediate feedback and, when there are errors, advise about how to correct them. Only a web browser is required to use the tool, which has been used in our university with very promising results.