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) REFERENCES Departments(DeptID) ); ``` (b) List names and salaries of employees in 'Technology' department sorted by salary descending: ```sql SELECT E.EmpName, E.Salary FROM Employees E JOIN Departments D ON E.DeptID
_____ __________ __________ _______ ___ ______ _____ __________ __________ ______ ______ _________.
__________ _________ _____ ___ __________ ________ ______ ___.
________ _____ __________ _____ ______ _______ ____ __________.
________ ________ __________ _________ ________ __________ ____ __________ _________.
___ _____ __________ ____ _________ __________ ______ ________ _______ ___ _______ ____.
_____ ____ ________ __________ _____.
________ _________ _____ ___ ________ ______ ______.
____ ____ _____ _______ _____ ____ ____ ____ _______ __________.
__________ _______ _____ ________ ____ ________.
___ _________ ________ _______ ___ ____ ____ ___ ____ _________ ______ ____.
________ ____ ________ __________ __________ ______ _____ _______ ______ _____.
_______ _____ ________ _____ __________ ___ ___ _______ ________.
__________ _____ ________ _____ _______ _____ ____ _______ _______.
_____ ______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCS 23 2025 2026 - Write and execute SQL queries for the following tasks. Make suitable a | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→