SQL Exercise 3

advertisement
SQL Exercise 3
This exercise will test your knowledge of the Data Query Language. This includes the SELECT command and its
various forms. You will use these commands to retrieve different kinds of information from the SOIS database you
created earlier.
Create a Notepad document named SQL_Exercise3_Submission.txt. Use this document to submit your responses to
the following questions. Your response must comprise two parts—successfully executed SEQUEL script and the
corresponding output. Outputs typically comprise a data table with clearly marked column headers. Since Notepad
does not display gridlines, you must ensure that data entries of each column are uniformly indented.
1. (3 points) Display the full names of all SOIS faculty members with their respective titles.
The header of the title column must read “Rank”.
2. (3 points) Display the full names and monthly salaries of all faculty members who earn
more than Thomas Johnson. Use only first and last names in your condition statement.
(Note: The values in the Salary column of the Faculty table correspond to annual
salaries).
3. (3 points) Display the different salary amounts drawn by SOIS faculty members in
descending order without any identifiable information. The output must include a single
column named “SOIS Salaries”.
4. (3 points) Display full names of all SOIS faculty members (under the header “Faculty
Name”) and annual taxes they pay (under the header “Tax Payable”). The standard tax
rate applicable is 20% per annum.
5. (3 points) Display all 3-credit courses offered by SOIS under the header “Three-Credit
Courses”.
6. (3 points) Display all courses whose name starts with an “S” under the header “The S’s”).
7. (3 points) Display locations and phone numbers of all departments whose names do not
contain the word “information” using the LIKE operator. The column headers displayed
should read “Office” and “Contact Number”.
8. (3 points) Display full names of all students who were born prior to January 1st 1990
using an arithmetic operator.
9. (3 points) Display the names of all faculty members hired in the 90s using the
BETWEEN operator.
10. (3 points) Display the names of all faculty members belonging to department numbers 54,
57, and 58 using an SQL operator.
Save all your work in the SQL_Exercise3_Submission.txt document. Submit the document in
the assigned D2L dropbox by 11:59pm on October 5th, 2012.
Download