This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHOW MATERIALIZED VIEWS LIKE 'INFARE' IN DATABASE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DESCRIBE MATERIALIZED VIEW dm_rmp.infare; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Cartesian product | |
SELECT employee_id, first_name || last_name full_name, job_id, department_name | |
FROM employees, departments; | |
-- Cartesian product with CROSS JOIN syntax | |
SELECT last_name, department_name | |
FROM employees CROSS JOIN departments; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Inner Join with the ON Clause | |
SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id | |
FROM employees e JOIN departments d | |
ON (e.department_id = d.department_id); | |
-- Inner Join with the Equal (=) Operator | |
SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id | |
FROM employees e, departments d | |
WHERE e.department_id = d.department_id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Joining more than two tables with JOIN and ON keywords | |
SELECT e.last_name, d.department_name, l.city | |
FROM employees e JOIN departments d | |
ON (e.department_id = d.department_id) | |
JOIN locations l | |
ON (d.location_id = l.location_id); | |
-- Joining more than two tables with equal (=) operator | |
SELECT e.last_name, d.department_name, l.city | |
FROM employees e, departments d, locations l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT e.last_name, e.salary, j.grade | |
FROM employees e, job_grades j | |
WHERE e.salary BETWEEN j.lowest_sal AND j.highest_sal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT e.last_name, e.department_id, d.department_name | |
FROM employees e LEFT OUTER JOIN departments d | |
ON (e.department_id = d.department_id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT e.last_name, e.department_id, d.department_name | |
FROM employees e RIGHT OUTER JOIN departments d | |
ON (e.department_id = d.department_id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT e.last_name, e.department_id, d.department_name | |
FROM employees e FULL OUTER JOIN departments d | |
ON (e.department_id = d.department_id); |