Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a SQL query based on the above database: Write a query to get the number of employees located by country. You dont have

image text in transcribedPlease write a SQL query based on the above database:

Write a query to get the number of employees located by country. You dont have to use the COUNTRY_NAME, you can use the COUNTRY_ID. Hint: Use employees, departments and locations tables.

Write a query to get the Average salary of all employees working as Programmers. Hint: Use the employees table.

countries regions REGION_ID REGION_NAME NUMBER EENEEMES VARCHAR2(25) Y COUNTRY_ID CHAR(2) COUNTRY_NAME VARCHAR2(40) REGION_ID NUMBER locations Y LOCATION_ID NUMBER STREET_ADDRESS VARCHAR2(25) POSTAL CODE VARCHAR2(12) CITY VARCHAR2(30) STATE_PROVINCE VARCHAR2(12) COUNTRY_ID CHAR(2) departments DEPARTMENT ID NUMBER DEPARTMENT_NAME VARCHAR2(30) MANAGER_ID NUMBER LOCATION ID NUMBER jobs employees EMPLOYEE_ID NUMBER FIRST_NAME VARCHAR2(20) LAST_NAME VARCHAR2(25) EMAIL VARCHAR2(25) PHONE NUMBER VARCHAR2(20) HIRE DATE DATE JOB ID VARCHAR2(10) SALARY NUMBER COMMISSION_PCT NUMBER MANAGER ID NUMBER DEPARTMENT_ID NUMBER JOB_ID VARCHAR2(10) JOB_TITLE VARCHAR2(35) MIN_SALARY NUMBER MAX_SALARY NUMBER job_history Y EMPLOYEE_ID START_DATE END_DATE JOB ID DEPARTMENT_ID job_grades NUMBER DATE DATE VARCHAR2(10) NUMBER GRADE LEVEL VARCHAR2(2) LOWEST SAL NUMBER HIGHEST SAL NUMBER The ER diagram of the database is given above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

Define outplacement and severance pay.

Answered: 1 week ago

Question

3. Is IBMs program really a mentoring program? Why or why not?

Answered: 1 week ago