Question

Write and execute SQL queries for the following tasks. Make suitable assumptions where necessary.

(a) Create the Employees table with EmpID as the primary key and DeptID as a foreign key referencing the Departments table. The Salary should not be negative. (4 Marks)

(b) List the names and salaries of all employees working in the 'Technology' department, sorted in descending order of their salary.

(c) Find the name of each department and the number of employees working in it. Display only those departments that have more than 10 employees.

 

(d) Find the names of all employees whose salary is greater than the average salary of all employees in the company.

 

(e) List the names of all projects along with the name of the employee who is leading the project.

12 Sep 2025
Answer :
Word Count : 198
Assuming we have two existing tables: `Departments(DeptID, DeptName)` and `Projects(ProjectID, ProjectName, LeadEmpID)`, here are the SQL queries for the tasks: (a) Create the Employees table: ```sql CREATE TABLE Employees ( EmpID INT PRIMARY KEY, EmpName VARCHAR(50) NOT NULL, DeptID INT, Salary DECIMAL(10,2) CHECK (Salary >= 0), FOREIGN KEY (DeptID) ______ ____ ________ _____ __________ ______ ___ _________ ________ ________ _________ ____.
___ _________ _______ ________ ________ ________ ________ ______ __________ _________ ___ ________.
___ ___ __________ _____ ______ ______ ______ ____ ________.
________ ____ _______ ________ _________ ____ ________ _______ ________.
____ ________ ________ _____ ________ ____ ______ ________.
______ ______ ___ _____ ____ _____.
____ ___ ___ ___ ____ ___ ________ _____ _____ _______ _______ __________.
______ ____ ____ _____ _____.
_____ ______ ________ ________ ____ ______ _____ __________.
_______ _____ ________ ______ ___ ____ _________ __________ ___ _________ _______ _______.
___ _______ ______ ____ _______ ______ ____ ______ ______ __________.
_____ ________ ______ ___ ____ ________.
___ _____ __________ _____ _______ __________ _________ _________ ________.
_________ ___ ________ ____ ________ _________ _____ __________ _______ _____ _______ _________.
_____ _______ ___ _______ ________ ______ ___ ________ ______.
_______ _____ _______ ____ _________ _______ ___ __________.
______ ______.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write and execute SQL queries for the following tasks. Make suitable a
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→