Homework 1: on Sakai
Rules:
0. Submit as a text file! (see also Rule 4)
1. Your queries should work even if additional data is added to the
tables.
2. Every table referred to in the FROM clause should be named with a
"table alias", that is e and d in:
select e.lname, d.dname from employee e, department d
...
3. All answers should be in the form of a single query; do not retrieve a
value with one query and then manually plug that value into a second
query. Similarly, data appearing in the query should be from the exercise
itself, and not from a "visual" lookup.
4. All SQL should be entered in a format that I can copy and paste
directly into a command window. In particular, make sure:
All "prompt" characters such as "->" have been
stripped out.
You use regular quotation marks, not special unicode
quotation marks. Unicode-quoted ‛foo’ is not the same as 'foo'. (A sure
way to convert inadvertently to unicode quotes is to paste your work into
a Word document; try installing Notepad++. Or, better yet, Atom.) Postgres
requires single quotation marks for strings: 'string'.
There are no leading tabs or spaces
5. Use explicit join notation for joins
select e.lname from EMPLOYEE E JOIN DEPARTMENT D ON
E.DNO = D.DNUMBER where...
Introduction to Relational Databases
Start with Mappings