1. Find the photoIDs of photos with tag Philadelphia and with averageScore higher than 3.5. 2. Find the names and emails of students whose advisors have Database as their research area. 3. Find the names of each professor and names of each student, who has at least one photo with averageScore higher than 4.5. 4. Find the studentIDs of each student whose advisor has been advising her for more than three years and is not yet her friend in PennPhoto. 5. Find the studentIDs of students with the highest GPA value.
2. Launch VMWare or VirtualBox and open the cis550-ubuntu/Ubuntu-cis550-vm.vmx le. In VMWare, choose Play virtual machine. When it asks you, answer that you copied the virtual machine. 3. A window should open with a Linux desktop. Log in with cis550 as ID (there should be no password). 4. Double-click on eclipse. You will see a loaded project in the workspace, called cis-550-hw1. 5. Try running the project: click on the triangle next to cis-550-hw1, then src, then edu.upenn.cis.cis550.hw1 to expand it, then right-click on Cis 550 hw1.gwt.xml and choose Run As. Choose Web Application. 6. When you see Cis 550 hw1.gwt.xml in the Development Mode window, enlarge the window or scroll down until you see a line starting with http://127.0.0.1. Double-click on this line. Firefox should launch, and a fter a while you should see a dialog box pop up with CIS 550 HW1 - Query Results. The output should be a relation schema and a single line of a table. 7. You can close Firefox and come back to Eclipse. Click on the red square for Stop in the Development mode pane, to end the Web server. 8. Now you should take a look at the project. Roughly speaking, there are three main parts to a Gogogle Web Toolkit project: code that runs on the server (in ...cis550.hw1.server), code that runs in the browser (in ...cis550.hw1.client), and code that gets passed from server to client and vice versa (in ...cis550.hw1.shared). 9. For the most part, you can just leave the code alone except on the server-side. The server side includes a series of data objects for Relations, Schemas, and the like in ...cis550.hw1.shared); a series of relational algebra operator classes in ...cis550.hw1.server.relalgebra; and a couple of classes for Boolean predicate evaluation in ...cis550.hw1.server.expressions. You will be making use of these to dene tables and query expressions. 10. For the most part, you can focus on the server code that actually creates the table to return to the Web browser this is QueryTablesImpl in ...cis550.hw1.server. Here we have some sample code for you to get started (this is what returns results when you run the current program). The methods createS() and createR() generate two simple relations. (You may easily add more.) In addition, the method getRelation() is the one that creates a Relation expression for the Web server. It currently composes a simple query out of Select, Project, and Join operators. You will need to compose a dierent expression. 11. We have already created the Student relation and inserted 100 tuples for you. You are required to create the relation Professor and the relation Advises. 12. You are required to insert tuples into relations Professor and Advises. You need to create ten professors with staIDs ranging from 10001 to 10010. Each professor has a name which is a string equals to the reverse of his staID. Professors with staID 10001, 10002, and 10003 have Database as their research areas. In addition, for each student with studentID i, create the following tuple in Advises t = {< 10001 + (i mod 10), i, (i mod 4) >}. You are not allowed to modify the Student relation. 13. Modify the getRelation() method so that it corresponds to your relational algebra expression in Problem 2.2. 14. Run your project as web application, as described above. You should see a webpage with the query results. It should match your expectations based on your understanding of the relational algebra and the data. 15. Finally, submit your QueryTablesImpl.java le to us using turnin. You can do this as follows: 3
(a) Open Terminal on the virtual machine desktop. (b) Type cd workspace/cis-550-hw1/src/edu/upenn/cis/cis550/hw1/server. (c) Type scp QueryTablesImpl userid @eniac.seas.upenn.edu where userid is your username on eniac. Log in with your password, and the le should be copied to your home directory. (d) Type ssh userid @eniac.seas.upenn.edu. Then type turnin -ccis550 -phw1 QueryTablesImpl.java. Then type exit to log out. Your grades will be based on correctness, implementation and style. You are not allowed to hard code the results.