We read your photo as:
Write SQL queries for the following: display all employees in the IT department, total salary in HR, names hired before 2020, and insert a new employee.
Computer Science
ScanSolve AI Answer
Here are the SQL queries for question 19:
a) Write a query to display all employees in the IT department.
SELECT *
FROM Employee
WHERE department = 'IT';
b) Find the total salary paid to employees in the HR department.
SELECT SUM(salary) AS TotalHRSalary
FROM Employee
WHERE department = 'HR';
c) Write a query to display the names of employees hired before 2020.
SELECT Names
FROM Employee
WHERE HireDate < '2020-01-01';
d) Insert a new employee into the employees table with the following details: employeeID: 6.
(Assuming the missing details for the new employee are 'New Employee' for Names, 'Sales' for department, 75000 for salary, and '2023-01-01' for HireDate.)
INSERT INTO Employee (ID, Names, department, salary, HireDate)
VALUES (6, 'New Employee', 'Sales', 75000, '2023-01-01');
Was this helpful?
Still stuck on this one?
Ask a follow-up, and the answer starts from this question.
Got a different question?Ask your own question
More Computer Science Questions
QWrite a SQL query to increase the salaries of employees in the 'Engineering' department by 5000.QHow do I fix the SQL error 'Table 'I220131570.Job' doesn't exist' and what are the correct SQL…QHow do I fix the SQL error 'ERROR 1064 (42000): You have an error in your SQL syntax' when inserting…QDetermine the primary keys, foreign keys, and composite keys for the given Employee, Emp_Salary, and…QCreate two queries: one for the sales department and one for male children born 1977-1979.
Browse by topic:SQL