Skip to content

Instantly share code, notes, and snippets.

@theabhayprajapati
Last active September 7, 2022 16:54
Show Gist options
  • Save theabhayprajapati/b3ad333528d7a2d3421a7c1a48ce5b88 to your computer and use it in GitHub Desktop.
Save theabhayprajapati/b3ad333528d7a2d3421a7c1a48ce5b88 to your computer and use it in GitHub Desktop.
SELECT e.Empno, e.LastName, d.DeptName from Employee e, Department d WHERE e.DeptID = d.DeptId ORDER BY d.DeptName,e.LastName DESC;
SELECT e.lastName, d.DeptID, d.DeptName from Employee e, Department d WHERE e.DeptID = d.DeptId;
SELECT DISTINCT desgn from Employee where DeptId = 1;
SELECT e.LastName, d.DeptName from Employee e, Department d WHERE e.LastName LIKE '%a%' AND e.DeptId = d.DeptID;
SELECT e.LastName, d.DeptName, d.City from Employee e, Department d WHERE e.DeptId = d.DeptId AND e.desgn = 'Manager' ORDER BY e.Empno;
SELECT CONCAT(e.FirstName, " ", e.LastName) "Employee", CONCAT(m.LastName, " ", m.FirstName) FROM Employee m INNER JOIN Employee e ON m.Desgn="Manager" AND e.DeptID = m.DeptId;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment