Question: CREATE TABLE LOCATION ( Location _ ID INT PRIMARY KEY, City VARCHAR ( 5 0 ) ) ; INSERT INTO LOCATION ( Location _ ID
CREATE TABLE LOCATION
LocationID INT PRIMARY KEY,
City VARCHAR
;
INSERT INTO LOCATION LocationID City
VALUES 'New Yo
Simple Queries:
List all the employee details.
List all the department details.
List all job details.
List all the locations.
List out the First Name, Last Name, Salary, Commission for all Employees.
List out the Employee ID Last Name, Department ID for all employees and
alias
Employee ID as ID of the Employee", Last Name as "Name of the
Employee", Department ID as "Depid
List out the annual salary of the employees with their names only.
WHERE Condition:
List the details about "Smith".
List out the employees who are working in department
List out the employees who are earning salaries between and
List out the employees who are working in department or
Find out the employees who are not working in department or
List out the employees whose name starts with S
SQL Certification Training
Contact us: support@intellipaat.com Copyright Intellipaat All rights reserved
List out the employees whose name starts with S and ends with H
List out the employees whose name length is and start with S
List out employees who are working in department and draw salaries more
than
List out the employees who are not receiving commission.
ORDER BY Clause:
List out the Employee ID and Last Name in ascending order based on the
Employee ID
List out the Employee ID and Name in descending order based on salary.
List out the employee details according to their Last Name in ascendingorder.
List out the employee details according to their Last Name in ascending
order and then Department ID in descending order.
GROUP BY and HAVING Clause:
How many employees are in different departments in the organization?
List out the department wise maximum salary, minimum salary and
average salary of the employees.
List out the job wise maximum salary, minimum salary and average
salary of the employees.
List out the number of employees who joined each month in ascendingorder.
List out the number of employees for each month and year in
ascending order based on the year and month.
List out the Department ID having at least four employees.
How many employees joined in the month of January?
How many employees joined in the month of January or September?
How many employees joined in
How many employees joined each month in
How many employees joined in March
Which is the Department ID having greater than or equal to employees
joining in April
SQL Certification Training
Contact us: support@intellipaat.com Copyright Intellipaat All rights reserved
Joins:
List out employees with their department names.
Display employees with their designations.
Display the employees with their department names and regional groups.
How many employees are working in different departments? Display with
department names.
How many employees are working in the sales department?
Which is the department having greater than or equal to
employees? Display the department names in ascending
order.
How many jobs are there in the organization? Display with designations.
How many employees are working in "New York"?
Display the employee details with salary grades. Use conditional statement to
create a grade column.
List out the number of employees grade wise. Use conditional statementto
create a grade column.
Display the employee salary grades and the number of employees
between to range of salary.
Display all employees in sales or operation departments.
SET Operators:
List out the distinct jobs in sales and accounting departments.
List out all the jobs in sales and accounting departments.
List out the common jobs in research and accounting
departments in ascending order.
Subqueries:
Display the employees list who got the maximum salary.
SQL Certification Training
Contact us: support@intellipaat.com Copyright Intellipaat All rights reserved
Display the employees who are working in the sales department.
Display the employees who are working as 'Clerk'.
Display the list of employees who are living in "New York".
Find out the number of employees working in the sales department.
Update the salaries of employees who are working as clerks on the basis of
Delete the employees who are working in the accounting department.
Display the second highest salary drawing employee details.
Display the nth highest salary drawing employee details.
List out the employees who earn more than every employee in department
List out the employees who earn more than the lowest salary in
department. Find out whose department has no employees.
Find out which department has no employees.
Find out the employees who earn greater than the average salary for
their department.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
