/* qry01 */ SQL> select first_name, last_name, phone 2 from student 3 / FIRST_NAME LAST_NAME PHONE ------------------------- ------------------------- --------------- Fred Crocitto 718-555-5555 J. Landry 201-555-5555 Laetia Enison 718-555-5555 ..................................................................... /* qry02 */ SQL> edit Wrote file afiedt.buf 1 select first_name, last_name, phone 2 from student 3* where phone like '718-%' SQL> / FIRST_NAME LAST_NAME PHONE ------------------------- ------------------------- --------------- Fred Crocitto 718-555-5555 Laetia Enison 718-555-5555 Catherine Mierzwa 718-555-5555 ..................................................................... /* qry03 */ SQL> select salutation, first_name, last_name 2 from instructor 3 where salutation = 'Dr' 4 / SALUT FIRST_NAME LAST_NAME ----- ------------------------- ------------------------- Dr Marilyn Frantzen ..................................................................... /* qry04 */ SQL> edit Wrote file afiedt.buf 1 select to_char(course_no) course_no 2 from course 3* order by course_no SQL> / COURSE_NO -------------------- 10 100 120 ..................................................................... /* qry05 */ SQL> col course_no format 9999999999 SQL> edit Wrote file afiedt.buf 1 select to_char(course_no) course_no, description, cost 2 from course 3 where cost = 1095 4* order by to_char(course_no, '099') SQL> / COURSE_NO DESCRIPTION COST ---------------------------------------- ------------------------------ ---------- 135 Unix Tips and Techniques 1095 230 Intro to Internet 1095 240 Intro to the Basic Language 1095 ..................................................................... /* qry06 */ SQL> edit Wrote file afiedt.buf 1 select grade_type_code, to_char(numeric_grade, '99') numeric_grade 2 from grade 3* where grade_type_code = 'FI' SQL> / GR NUM -- --- FI 85 FI 92 FI 91 ..................................................................... /* qry07 */ SQL> EDIT Wrote file afiedt.buf 1 select grade_type_code, to_char(numeric_grade, '99') numeric_grade 2 from grade 3* where grade_type_code in ('PA', 'QZ', 'MT') and rownum < 5 SQL> / GR NUM -- --- MT 90 PA 85 QZ 90 QZ 84 ..................................................................... /* qry08 */ SQL> edit Wrote file afiedt.buf 1 select grade_type_code, to_char(grade_code_occurrence, '99') grade_code_occurrence 2 from grade 3 where grade_code_occurrence > 5 and rownum < 5 4* order by grade_code_occurrence SQL> / GR GRA -- --- PA 6 PA 7 PA 8 PA 9 ..................................................................... /* qry09 */ SQL> edit Wrote file afiedt.buf 1 select lpad(to_char(course_no, '999'), 9) course_no, description, cost 2 from course 3 where instr(description, 'Programming') > 0 4* order by lpad(to_char(course_no, '999'), 9) SQL> / COURSE_NO DESCRIPTION COST --------- ---------------------------------------- ---------- 25 Intro to Programming 1195 80 Structured Programming Techniques 1595 120 Intro to Java Programming 1195 122 Intermediate Java Programming 1195 124 Advanced Java Programming 1195 147 GUI Programming 1195 220 PL/SQL Programming 1195 450 DB Programming in Java 8 rows selected. ..................................................................... /* qry10 */ SQL> select course_no, description, cost 2 from course 3 where cost >= 1250 4 / COURSE_NO DESCRIPTION COST ----------- ---------------------------------------- ---------- 80 Structured Programming Techniques 1595