Csc 1302, Honors Principles of Computer Science II (Fall 2021)

Week 9 (22 October 2021)

Phase 1 Testing

  1. During this week you will write Java programs to answer queries 4, 5, and 7 from Company Database Queries in Relational Algebra
  2. Run all 7 Java programs to see if you get correct answers. This should test all of the code that you have developed until now.
Mac-mini:w7 raj$ java Query1 company
ANSWER(FNAME:VARCHAR,LNAME:VARCHAR,ADDRESS:VARCHAR)
Number of tuples: 4

Franklin:Wong:638 Voss, Houston, TX:
John:Smith:731 Fondren, Houston, TX:
Ramesh:Narayan:971 Fire Oak, Humble, TX:
Joyce:English:5631 Rice, Houston, TX:

Mac-mini:w7 raj$ java Query2 company
ANSWER(PNUMBER:INTEGER,DNUM:INTEGER,LNAME:VARCHAR,ADDRESS:VARCHAR,BDATE:VARCHAR)
Number of tuples: 2

10:4:Wallace:291 Berry, Bellaire, TX:20-JUN-31:
30:4:Wallace:291 Berry, Bellaire, TX:20-JUN-31:

Mac-mini:w7 raj$ java Query3 company
ANSWER(LNAME:VARCHAR,FNAME:VARCHAR)
Number of tuples: 2

Zelaya:Alicia:
Jabbar:Ahmad:

Mac-mini:w7 raj$ java Query4 company
ANSWER(PNO:INTEGER)
Number of tuples: 3

1:
2:
3:

Mac-mini:w7 raj$ java Query5 company
ANSWER(LNAME:VARCHAR,FNAME:VARCHAR)
Number of tuples: 3

Wong:Franklin:
Smith:John:
Freed:Alex:

Mac-mini:w7 raj$ java Query6 company
ANSWER(LNAME:VARCHAR,FNAME:VARCHAR)
Number of tuples: 34

Borg:James:
Zelaya:Alicia:
Narayan:Ramesh:
English:Joyce:
Jabbar:Ahmad:
James:Jared:
James:John:
Jones:Jon:
Mark:Justin:
Knight:Brad:
Wallis:Evan:
Zell:Josh:
Vile:Andy:
Brand:Tom:
Vos:Jenny:
Carter:Chris:
Grace:Kim:
Chase:Jeff:
Snedden:Sam:
Ball:Nandita:
Bender:Bob:
Jarvis:Jill:
King:Kate:
Leslie:Lyle:
King:Billie:
Kramer:Jon:
King:Ray:
Small:Gerald:
Head:Arnold:
Pataki:Helga:
Drew:Naveen:
Reedy:Carl:
Hall:Sammy:
Bacher:Red:

Mac-mini:w7 raj$ java Query7 company
ANSWER(LNAME:VARCHAR,FNAME:VARCHAR)
Number of tuples: 3

Wong:Franklin:
Wallace:Jennifer:
Freed:Alex: