Now create, run, and test SQL queries to display each set of information below.
ID: 3801246 • Letter: N
Question
Now create, run, and test SQL queries to display each set of information below. Save a copy of your queries in a Microsoft Word document. Include a screen shot of the output immediately after the corresponding SQL query.
The SQL queries will display the following:
The name and data type of every column of the EMPLOYEES table
The values in all rows and columns of the DEPARTMENTS table
The employee identification number, employee name, and department identification number for every employee
The employee identification number and salary of all employees earning more than $3,000
The employee identification number, employee name, and department name for all employees whose identification number is less than 103 or greater than 203
The employee name, head of the department (HOD), and salary for all employees whose salary is not in the range of $5,000–$ 10,000
The job identification number, job description, and joining date of employees who have been hired between December 01, 2007, and June 01, 2008
The complete employee detail for all employees whose last names start with S
The employee name and department identification number of all employees belonging to department identification number 10 or 20
The employee name, department identification number, and department name for all employees
The employee name, department name, and location of the department for all employees who earn a salary greater than $15,000
The employee name and employee identification number along with their HOD's name and identification number
The employee name, job description, department name, location of the department, basic salary, and grade for all employees
The employee identification number and joining date for employees who have been hired after Jack was hired
The employee name and department name for all employees, whether they have a department or not
Explanation / Answer
Here are the first 4 queries for you:
/*The name and data type of every column of the EMPLOYEES table*/
DESC Employees; --Will list the name and type of every column in Employees.
/*The values in all rows and columns of the DEPARTMENTS table*/
SELECT * FROM DEPARTMENTS; --Will list the content of the DEPARTEMENTS table.
/* The employee identification number, employee name, and department
identification number for every employee*/
SELECT EMPLOYEE_ID, EMPLOYEE_NAME, DEPARTMENT_ID FROM EMPLOYEES;
/*The employee identification number and salary of all employees earning more than $3,000*/
SELECT EMPLOYEE_ID, SALARY FROM EMPLOYEES WHERE SALARY > 3000;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.