Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Please use following table information to answer the questions?
SQL> DESC DEPARTMENTS
Name Null? Type
----------------------------------------- -------- ----------------------------
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
SQL> DESC DEPARTMENTS
Name Null? Type
----------------------------------------- -------- ----------------------------
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
SQL> DESC EMPLOYEES
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
Exercises:
1. Display the last name and current job title of each employee, along with the department name they are
currently working in. Label the columns "LAST NAME", "JOB TITLE", and "DEPARTMENT".
2. Display the average salary for each department, along with the department name and the number of
employees in that department. Label the columns "DEPARTMENT", "AVERAGE SALARY", and
"NUMBER OF EMPLOYEES".
3. Display the last name, hire date, and current salary for all employees who have received a promotion
since their hire date. Label the columns "LAST NAME", "HIRE DATE", "CURRENT SALARY", and
"PROMOTION DATE".
4. Display the first name, last name, and salary of all employees who have a salary that is higher than the
average salary for their department. Label the column "EMPLOYEE", "SALARY", and
"DEPARTMENT".
5. Display the last name, hire date, and salary for all employees who have been with the company for
more than 5 years. Label the columns "LAST NAME", "HIRE DATE", and "SALARY".
6. Display the concatenation of employees’ last name and salary (separated by comma) under the column
heading "EMPLOYEES AND THEIR SALARIES ".
7. Display the last name, hiredate, salary and salary increased by 10% for each employee. Label the new
column NEW SALARY.
8. Display the full name, salary and add a column that subtracts the old salary from the new salary. Label
the column INCREASE. The new salary is increased by 10%.
9. Display the first name and last name of employees whose first name contain ‘N’ in the last second
character.
10. For each employee, display the employee’s last name and calculate the number of months between
today and the date the employee was hired. Label the column MONTHS_WORKED. Order your results
by the number of months employed.
11. Display the first name and salary of all employees in the following format:
<employee_name> earns $<employee_salary> but wants $<3* employee_salary>
Label the column “Dream Salaries”
1. Display the last name and current job title of each employee, along with the department name they are
currently working in. Label the columns "LAST NAME", "JOB TITLE", and "DEPARTMENT".
2. Display the average salary for each department, along with the department name and the number of
employees in that department. Label the columns "DEPARTMENT", "AVERAGE SALARY", and
"NUMBER OF EMPLOYEES".
3. Display the last name, hire date, and current salary for all employees who have received a promotion
since their hire date. Label the columns "LAST NAME", "HIRE DATE", "CURRENT SALARY", and
"PROMOTION DATE".
4. Display the first name, last name, and salary of all employees who have a salary that is higher than the
average salary for their department. Label the column "EMPLOYEE", "SALARY", and
"DEPARTMENT".
5. Display the last name, hire date, and salary for all employees who have been with the company for
more than 5 years. Label the columns "LAST NAME", "HIRE DATE", and "SALARY".
6. Display the concatenation of employees’ last name and salary (separated by comma) under the column
heading "EMPLOYEES AND THEIR SALARIES ".
7. Display the last name, hiredate, salary and salary increased by 10% for each employee. Label the new
column NEW SALARY.
8. Display the full name, salary and add a column that subtracts the old salary from the new salary. Label
the column INCREASE. The new salary is increased by 10%.
9. Display the first name and last name of employees whose first name contain ‘N’ in the last second
character.
10. For each employee, display the employee’s last name and calculate the number of months between
today and the date the employee was hired. Label the column MONTHS_WORKED. Order your results
by the number of months employed.
11. Display the first name and salary of all employees in the following format:
<employee_name> earns $<employee_salary> but wants $<3* employee_salary>
Label the column “Dream Salaries”
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 6 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Similar questions
- SQL script which is the physical design for this database ### Animals This table contains the following data about all animals in the zoo. - animal ID (primary key) - animal name - animal birthdate - species - habitat (foreign key) [1 habitat to many relationship] ### Habitats This table contains data about the habitats in the zoo. Each animal lives in a specific habitat. The habitat table should include the following data - habitat name, foreign key) - habitat location ### Database CREATE DATABASE zoo; Write queries to create the tables. Be sure to include primary keys for each table and the required foreign keys and referential integrity actions. Add appropriate indexes. This database requires at least 2 indexes in addition to those automatically created by MySQL.arrow_forwardList the main non-SQL data management systems and compare their pros and cons to relational DBMSs.arrow_forward1. Open SQL Microsoft SQL Management Studio. 2. Create a database named DB_CompanyX. 3. Create tables for the database. See Table 1 for the table name, column name, and data type. Table 1. Creating Tables Table Name Data Type Column EMPLOYEE_NO *primary key* BIGINT BIRTH_DATE DATE FIRST_NAME VARCHAR (50) TBL_EMPLOYEE LAST_NAME VARCHAR (50) GENDER VARCHAR HIRE_DATE DATE EMPLOYEE_NO *foreign key* BIGINT TITLE VARCHAR (50) TBL_EMP_TITLE FROM_DATE DATE TO_DATE DATE EMPLOYEE_NO *foreign key* BIGINT SALARY INT TBL_EMP_SALARY FROM_DATE DATE TO_DATE DATE EMPLOYEE_NO *foreign key* BIGINT DEPARTMENT_NO *foreign key* CHAR (10) TBL_DEPT_EMP FROM_DATE DATE TO_DATE DATE 02 Task Performance 1 *Property of STI Page 1 of 2 STI IT1924 DEPARTMENT_NO *primary key* CHAR (10) TBL_DEPARTMENTS DEPARTMENT_NAME VARCHAR (40) DEPARTMENT_NO *foreign key* CHAR (10) EMPLOYEE_NO *foreign key* BIGINT TBL_DEPARTMENT_MANAGER FROM_DATE DATE TO_DATE DATE 4. Create a database diagram and include all the tables. 5. Using…arrow_forward
- Please provide a correct, clear answer for this SQL question 4)arrow_forwardLet’s say you have two SQL tables: authors and books The authors dataset has 1M+ rows; here’s the first six rows:author_name book_name author_1 book_1 author_1 book_2 author_2 book_3 author_2 book_4 author_2 book_5 author_3 book_6……The books dataset also has 1M+ rows and here’s the first six:book_name sold_copies book_1 1000 book_2 1500 book_3 34000 book_4 29000 book_5 40000 book_6 4400……Create an SQL query that shows the TOP 3 authors who sold the most books in total!arrow_forwardUSE this part to write SQL statements at the bottom questions 1-11 Branch(branch_id:integer, branch_name:varchar(50), branch_location:varchar(40), money_on_hand:numeric(15,2) create table Branch (branch_id integer, branch_name varchar(50), branch_location varchar(40), money_on_hand numeric(15,2), primary key (branch_id)); Loan(loan_number:integer, branch_id:integer, amount:numeric(8,2)) foreign key branch_id references Branch(branch_id) create table Loan (loan_number integer, branch_id integer, amount numeric(8,2), primary key (loan_number), foreign key (branch_id) references Branch (branch_id)); Customer(customer_id:integer, customer_last_name:varchar(35),customer_first_name:varchar(25), customer_street:varchar(30),…arrow_forward
- please use sql to answer the following questionarrow_forwardGiven the following schema, answer the following questions USERS Attribute Data Type USER_ID NUMBER(3) USER_NAME VARCHAR2(20) USER_TYPE VARCHAR2(10) USER_LIMIT NUMBER(1) BOOKS Attribute Data Type BOOK_ID NUMBER(5) BOOK_TITLE VARCHAR2(25) BOOK_YEAR VARCHAR2(4) Write the SQL code that will create the tables structures for the tables named Books, and Users. Identify and include any PK and FK for both tables.arrow_forward1) Using update statement to increase the salary of a manager by 10% if he/she works on more than 1 projects sponsored by other division. pls help with this question! show sql codes and no spamming pls!arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY