Q12

txt

School

Indian Institutes of Management *

*We aren’t endorsed by this school

Course

123A

Subject

Information Systems

Date

Nov 24, 2024

Type

txt

Pages

1

Uploaded by sujibbarman

Report
Question: Write an SQL query to find all employees whose name starts with 'J'. Answer: SELECT * FROM employees WHERE name LIKE 'J%'; Question: How do you list the top 3 highest salaries in the 'employees' table? Answer: SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 3; Question: Write a query to find the average salary in each department of a company. Answer: SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department; Question: How can you increase the salary of all employees by 10%? Answer: UPDATE employees SET salary = salary * 1.10; Question: Write an SQL query to list all orders that were placed between January 1, 2020, and December 31, 2020. Answer: SELECT * FROM orders WHERE order_date BETWEEN '2020-01-01' AND '2020-12- 31';
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help