For this assignment you will work in your assigned small group of 2 or 3 students. You may not work with other groups, and the share of workload must be even between all group members. Failing to do either is a violation of the department Academic Integrity policy. Please read over Expectations for Working with Partners on CS Lab work
Lab 2 Group List for Lab Section A
Lab 2 Group List for Lab Section B
Next, clone your Lab 2 git repo into your cs44/labs subdirectory, cd into your repo:
cd cd cs44/labs git clone [the ssh url to your repo] cd Lab2-partner1-partner2-partner3Here are some instructions on Using Git page (follow the instructions for repos on Swarthmore's GitHub Enterprise server).
If all was successful, you will have cloned your Lab2 starting point with a .gitignore file for latex, and a README.md file into which you should enter your names, late days, and answer some questions about this lab after you have completed it.
This lab is different from the previous labs in that it has no programming. Instead, you solve problems by applying ER and Relational data base design, and you will get some practice defining relations in SQL using the sqlite3 system. We will revisit SQLite in more detail later in the semester.
Your group will submit a single solution to these problems. You may use any software you'd like for writing up your solution, but you must submit ER diagrams as figures. Thus, you will need to use some figure drawing software like powerpoint, xfig, gimp, google docs, ...., to create a pdf of the ER diagrams.
I encourage you to try using latex for your lab write-up. Using latex is not required, but if you'd like to try it out, here is an example latex document that you could use as a starting point for your write-up:
cp /home/newhall/public/latex_examples/report/* .Some information about using latex is available off my help pages: latex, openoffice, xfig, gimp
You will submit a single ERModel.pdf file with your answers to the following questions:
You will create a new database named lab2.db for this problem. If you run into errors in sqlite, you can always rm lab2.db and start again. Refer to the Week 4 lab page for sqlite examples and references.
sqlite3 lab2.db
Employees(eid, name, salary)List the schema in sqlite to verify that you have correctly created these relations.
Department(did, dname, address)
WorksAt(empid, deptid, date_hired)
I recommend that you use bulk loading from files for this part. Create 3 ascii files for each relation, each containing relation instances. Use the $ delimiter. Then try bulk loading them into your lab2.db database. You could also run INSERT INTO SQL statements to add values in one at a time.
Run SELECT queries to list the relation instances from each relation to verify that you have correctly added relation instances to these three relations.
SELECT E.name, D.dname FROM Employees E, Department D, WorksAt W WHERE E.eid = W.empid AND D.did = W.deptid;It should produce a result relation consisting of the name of each employee and the name of the department in which they work.
Before the Due Date, push your solution to github from one of your local repos to the GitHub remote repo. Only one of you and your partners needs to do this, but it doesn't hurt if you all do.
From your local repo (in your ~you/cs44/labs/Lab02-partner1-partner2 subdirectory)
make clean git add ERModel.pdf git add relationalModel.txt git add lab2.db git commit -m "solutions for lab 2" git pushIf you do your write-ups in latex, then add to your git repo the latex and image sources and the Makefile (you do not need to add the generated .pdf file containing your answers, as long as you add, commit, and push all of the components that I need to build it):
git add Makefile git add ERModel.tex # or whatever you named this file git add fig1.pdf # "" "" ...
If that doesn't work, take a look at the "Troubleshooting" section of the Using git page. Also, be sure to complete the README.md file, add and push it.