Using the tables and SQL statements from the prompt for Module Two Activity, answer the following
questions. Replace the bracketed text with your answers.
1. How many records are shown in the Employee table?
[There are five records.]
2. How many attributes are there in the Branches table?
[There are two attributes in the Branches table.]
3. Which attribute could be a primary key for the Employee table?
[The Employee_ID attribute could be a primary key because it identifies an employee.]
4. How many decimal places (maximum) can be stored in an employee’s salary field?
[There can be a maximum of two decimal places within the salary field. It is identified as Decimal (7,2)]
5. How many decimal places (maximum) can a Department_ID have?
[There is a maximum of zero decimals in the Department_ID because it is listed as a SMALLINT as written
here: Department_ID SMALLINT.]
6. What three rules do tables obey?
[The three rules that tables must obey are: they are normalized, meaning that only one value is placed in
each cell, there are no duplicate column names within the same table, and there are no duplicate rows
within the same table.]
7. How do you know that the Employee table is or is not normalized?
[I know that the Employee table is normalized because it is organized into rows and columns and the
information within each column directly relates to the row heading. Although some of the information is
the same, the way it is set up shows that the data that is within each cell is unique to a certain main
topic of the table and within the rows.]
8. What is the result of the following query? - Select sum(Salary) from Employee where
Department_ID=3;
[The sum of the salary from employees who are in department 3 would be totaled and the output or
result would be 170000.00 (80000+90000). The reason it will not show a comma is because commas are
used in the commands.]
9. How many rows are returned as a result of the following query? - Select * from Employee where
Classification<> 'Exempt';
[There are two rows that would be returned because there are only two employees with the Exempt
status.]
10. What is the result of the following query? - Select max(Salary) from Employee;
[The result would be a table that shows max(Salary) as the heading and one cell that lists the maximum
salary as 90000.00.]
Introduction to Structured Query Language Module Two Activity Template
of 1
Report
Tell us what’s wrong with it:
Thanks, got it!
We will moderate it soon!
Struggling with your assignment and deadlines?
Let EduBirdie's experts assist you 24/7! Simply submit a form and tell us what you need help with.