In this lab you will work with Queries to create new Relations from old. Queries are questions about the data in the database - essentially the Relational Algebra Operators covered in lectures. The lab is based on the database
| Cars | RegNum | Owner | Address |
| 92-KE-191 | H. Saville | Maynooth | |
| 99-TS-430 | P. Kelly | Clonmel |
| Officer | RegNum | Surname | Firstname |
| 567 | White | John | |
| 513 | Burke | NULL |
| Offence | Code | Date | Officer | CarReg |
| 18 | 03/10/97 | 513 | 99-TS-430 | |
| 19 | 04/04/98 | NULL | 99-TS-430 | |
| 20 | NULL | 513 | NULL |
which is also available at
| Code |
| 18 |
By entering 18 in the Criteria: box, it is understood that Code=18 is the condition. This matches the first tuple in the Offence table.
| Code | Date | Officer | CarReg |
| 18 | 3/10/97 | 513 | 99-TS-430 |
What we have performed here is effectively a select operation on the offence relation with condition C as Code=18, i.e. sCode=18(offence).
| Code | Date | Officer | CarReg |
| 19 | 4/4/98 | 99-TS-430 | |
| 20 | 513 |