Monday, February 15, 2010

Recitation #4 Slides

The slides for the fourth recitation (r4) are available through the link below:

http://www-student.cse.buffalo.edu/~dlessa/cse462-SP10/r4.pdf

The practice queries for DBLP are also available here:

http://www-student.cse.buffalo.edu/~dlessa/cse462-SP10/dblp-practice.sql

Before running the queries against the database don't forget to prepend all table names with my schema name, DLESSA, as explained in the slides. If you have problems connecting to Oracle or accessing the tables under my schema, please drop me an e-mail ASAP.

Thursday, February 11, 2010

Monday, February 8, 2010

DISTINCT in SQL

Some clarification is needed after the discussion of DISTINCT in the class today:

1. SELECT DISTINCT A1,...,An FROM...WHERE...GROUP BY...HAVING...
results in eliminating duplicates from the result of the query
SELECT A1,...,An FROM...WHERE...GROUP BY...HAVING...
I.e., duplicate elimination is the last step in SELECT query evaluation.

2. SELECT COUNT(DISTINCT A)...eliminates duplicates from the single column A before applying COUNT (the same for other aggregate functions except COUNT(*)).

3. DISTINCT cannot be used with COUNT(*). So if one wants to count the number of distinct tuples in a relation, one needs to define a view using SELECT DISTINCT and then compute COUNT(*) over the view.

Additional office hours before the test

I will be in my office tomorrow from 11am to 3pm, and Wednesday from 1:30 to 2:30pm.

--Jan Chomicki

Friday, February 5, 2010

Recitation #3 Slides

The slides for the third recitation (r3) are available through the link below:

http://www-student.cse.buffalo.edu/~dlessa/cse462-SP10/r3.pdf

Please, go over the queries in the slides and make sure you understand them. Make sure you also understand the solutions to the Advanced SQL Queries posted by Dr. Chomicki.

If you have questions, you may stop by any time during my office hours. If you cannot make to my office hours (or the professor's), shoot me an e-mail and I'll try to meet you some other time.

Monday, February 1, 2010

Java References

For those of you who asked me for some Java references, here they go:

Thinking in Java, 3rd edition, by Bruce Eckel. This is an excellent free online book. I strongly recommend:

http://www.mindview.net/Books/TIJ/

For a number of good video tutorials on both Java and Eclipse, visit:

http://eclipsetutorial.sourceforge.net/

Hope this helps!

Demian

Advanced SQL queries