{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman{\*\falt Thorndale};}{\f1\froman\fprq2\fcharset0 Times New Roman{\*\falt Thorndale};}{\f2\froman\fprq2\fcharset0 Times New Roman;}{\f3\fmodern\fprq1\fcharset0 Courier New;}{\f4\fnil\fprq2\fcharset0 HG Mincho Light J;}{\f5\fnil\fprq2\fcharset0 Arial Unicode MS;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033\snext1 Default;}
{\*\cs3\cf1\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033 Numbering Symbols;}
}
{\info{\author Sharon Tuttle}{\creatim\yr2003\mo2\dy24\hr9\min6}{\operator Sharon Tuttle}{\revtim\yr2003\mo2\dy28\hr9\min14}{\printim\yr2003\mo2\dy28\hr9\min14}{\comment StarWriter}{\vern6410}}\deftab1250
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default;}}
\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033\qc\ltrch\loch\fs22\b {\ltrch\loch\f0 HUMBOLDT STATE UNIVERSITY}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033\li420\ri0\fi-420\qc\ltrch\loch\f2\fs22\b {\ltrch\loch\f2 Spring 2003 - CIS 180 L - Section 3 - Intro to SQL}
\par {\ltrch\loch\f2 Homework #2 - Due by 10:00 am on Monday, March 3rd}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033\li420\ri0\fi-420\ltrch\loch\f2\fs22 
\par {\ltrch\loch\f2 This time, precede each of your answers to the following (except for #1! 8-) ) with a {\b prompt}{\b0  command containing the number of the question being "answered" by that statement/those statements. (for example,\tab }{\b\f3 prompt === question #2 === }{\b0\f2 )}}
\par 
\par {\ltrch\loch\f2 1.\tab Create a SQL script named {\b 180hw02.sql}. Then, {\b inside}{\b0  of this SQL script, start by beginning spooling to an output file named }{\b 180hw02_results.txt}{\b0 .}}
\par 
\par {\ltrch\loch\f2{\b0 2.\tab Use }{\b prompt}{\b0  commands to write a line containing your name, and then an empty line.}}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033\li420\ri0\fi-420\ltrch\loch\f2\fs22 
\par {\ltrch\loch\f2 3. \tab Select just those rows of the {\b empl} table where the salary is less than 1200.}
\par 
\par {\ltrch\loch\f2{\b0 4.\tab Select just those rows of the }{\b empl}{\b0  table where the job title is NOT 'Salesman'.}}
\par 
\par {\ltrch\loch\f2 5.\tab Select just those rows of the {\b empl} table where the job title is Clerk and the hiredate is after October 1, 1991 ('01-OCT-1991').}
\par 
\par {\ltrch\loch\f2 6.\tab Select just those rows of the {\b empl} table where the mgr is 7839 or the department number is 200.}
\par 
\par {\ltrch\loch\f2 7. \tab Using {\b IN}, select just those rows of the {\b dept} table with location Dallas, Chicago, or Boston.}
\par 
\par {\ltrch\loch\f2 8.\tab Using {\b BETWEEN}, select just those rows of the {\b empl} table with salaries between 1100 and 1600, inclusive.}
\par 
\par {\ltrch\loch\f2 9.\tab Select just those rows of the {\b empl} table that have no value in their {\b mgr} column.}
\par 
\par {\ltrch\loch\f2 10.\tab Consider your answer to #8. First rewrite it so that the selected rows will be displayed in order of increasing salary. Then, rewrite it so that the selected rows will be displayed in order of decreasing hiredate (most-recently-hired first).}
\par 
\par {\ltrch\loch\f2 11.\tab Consider your answer to #4. Rewrite it so that the selected rows will be displayed in order of job title, and for those with the {\b same} job title, in order of increasing hiredate. Then, rewrite it so that the selected rows will be displayed in reverse or
der of department number, and for those with the {\b same} department number, in order of increasing salary.}
\par 
\par {\ltrch\loch\f2{\b0 12.\tab Write a query that will select those rows of the }{\b empl}{\b0  table where the job title is 'Salesman', but will only project the last name and the {\b sum} of the salary and commission for those salesmen.}}
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033\ltrch\loch\f2\fs22 {\ltrch\loch\f2 Don't forget to {\b spool off}{\b0  at the end of your script!}}
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af5\afs24\lang255\ltrch\dbch\af4\afs24\langfe255\loch\f0\fs24\lang1033\li420\ri0\fi-420\ltrch\loch\f2\fs22 {\ltrch\loch\f2 Run your script several times, and study the results file carefully until you are satisfied with it. Then, e-mail to me the final versions of your {\b 180hw02.sql} and {\b 180hw02_results.txt}, each in a separate e-mail address whose Subject: line is the name of the
 file, and with the file contents{\b  included} in the message,{\b\ul  not attached}{\ulnone .}{\b\ul  }}
\par }