Please read through this page entirely and carefully before beginning your work.
Consider the following simple database of information about certain employees and companies for which they work.
employee(ename, street, city) | — records residential addresses |
company(name, city) | — records business location |
works(ename, name, salary) | — employment & salary info; name = company name |
manages(ename, mname) | — org chart info; mname = manager name |
With respect to this database, consider the following queries.
Give domain relational calculus expressions to answer each of the queries listed above.
Note that some printings of the textbook have severe typos in the discussion of relational calculus. Please consult the errata on the textbook's website as you read that particular chapter.
Give a QBE solution for each of the queries listed above.
If you will be using LaTeX to produce your PDF for this part and you need help with it, please study the example in ~cs33/data/hw1_example.tex to see how it's done. As always, you don't have to use LaTeX, and you always have the option of scanning a handwritten solution.
Give XQuery expressions for queries (b) through (h) above. In each case, your expression should answer the query by generating HTML output that is nicely formatted to make a pleasing display in a modern web browser. Thus, you may want to use <ul>, <li>, <table>, etc.
To help you get started, the file ~cs33/data/hw4_prob4a.xq contains a solution for item (a) above. To run the query, use the following commands at the Unix prompt.
cd ~cs33/data PATH=$PATH:~cs33/bin (change this appropriately if using csh) qizx -i emp.xml hw4_prob4a.xq
<!DOCTYPE employment SYSTEM "your_submission.dtd">