postgresql7.4 SELECT stream_id, stream_name FROM cc_stream WHERE department_id = :department_id SELECT f.faculty_id, f.faculty_name FROM cc_faculty f, cc_department d WHERE d.department_id = :department_id AND f.faculty_id = d.faculty_id