0% found this document useful (0 votes)
0 views

SQL Queries for Relational Algebra

The document provides SQL queries that correspond to specific relational algebra operations. It includes queries to list employees based on their residence, salary range, department, dependents, and department managers. Each query is presented with its SQL syntax for clarity.

Uploaded by

gloryrp58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

SQL Queries for Relational Algebra

The document provides SQL queries that correspond to specific relational algebra operations. It includes queries to list employees based on their residence, salary range, department, dependents, and department managers. Each query is presented with its SQL syntax for clarity.

Uploaded by

gloryrp58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL Equivalent Queries for Relational Algebra

(i) List all the employees who reside in 'Belagavi'


SELECT * FROM EMP WHERE Address = 'Belagavi';

(ii) List all the employees who earn salary between 30000 and 40000
SELECT * FROM EMP WHERE Salary BETWEEN 30000 AND 40000;

(iii) List all the employees who work for the 'Sales' department
SELECT * FROM EMP JOIN DEPT ON EMP.DNo = DEPT.DNo WHERE Dname = 'Sales';

(iv) List all the employees who have at least one daughter
SELECT DISTINCT EMP.* FROM EMP JOIN DEPENDENT ON EMP.Eno = DEPENDENT.Eno
WHERE Drelation = 'Daughter';

(v) List the department names along with the names of the managers
SELECT Dname, Ename FROM DEPT JOIN EMP ON DEPT.MgrEno = EMP.Eno;

You might also like