SQL Assignment-overview of Ai
SQL Assignment-overview of Ai
(as the Primary Key), FirstName, LastName, DepartmentID (as a Foreign Key), and Salary. Ensure that
EmployeeID is unique and that DepartmentID references a valid entry in the Departments table.
Update the department of employees based on their JobTitle, assuming that those with the
title 'Sales Manager' belong to the Sales department.
Q-3
Smartwatch 15 900
Smartphone 30 100
Neckband 5 80
DSLR 8 200
camera
Write an SQL query to calculate the total value (Quantity × Price) of each product.
Write an SQL query to find the product with the highest price.
Q-4
San
105 Fatima Noor 75000 30
Francisco
a.
Write an SQL query to retrieve the names and salaries of employees who are older than 30.
b.
Write an SQL query to update the salary of the employee with EmployeeID 103 to 70,000.
c.
Write an SQL query to find the average salary of all employees located in 'New York' or 'Los Angeles'.
d.
Write an SQL query to delete the record of the employee named 'Daniel Kim'.