Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeanhwea committed Jun 29, 2024
1 parent ddcde31 commit 6369386
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions assets/join3-prepare-example.org
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,31 @@
#+END_SRC
- preparation
#+BEGIN_EXAMPLE
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `e`.`first_name` AS
`first_name`,`e`.`last_name` AS `last_name`,`a`.`from_date` AS `from_date`
from ((`dept_manager` `a` join `departments` `d` on((`a`.`dept_no` =
`d`.`dept_no`))) join `employees` `e` on((`a`.`emp_no` = `e`.`emp_no`)))
where (`d`.`dept_no` = 'd001')"
},
{
"transformations_to_nested_joins": {
"transformations": [
"JOIN_condition_to_WHERE",
"parenthesis_removal"
],
"expanded_query": "/* select#1 */ select `e`.`first_name` AS
`first_name`,`e`.`last_name` AS `last_name`,`a`.`from_date` AS
`from_date` from `dept_manager` `a` join `departments` `d` join
`employees` `e` where ((`d`.`dept_no` = 'd001') and (`a`.`emp_no` =
`e`.`emp_no`) and (`a`.`dept_no` = `d`.`dept_no`))"

}
]
}
#+END_EXAMPLE

* join3_02
Expand All @@ -33,6 +57,33 @@
where
a.dept_no = d.dept_no and a.emp_no = e.emp_no and d.dept_no = 'd001';
#+END_SRC
- preparation
#+BEGIN_EXAMPLE
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `e`.`first_name` AS
`first_name`,`e`.`last_name` AS `last_name`,`a`.`from_date` AS `from_date`
from ((`dept_manager` `a` join `departments` `d`) join `employees` `e`)
where ((`a`.`dept_no` = `d`.`dept_no`) and (`a`.`emp_no` = `e`.`emp_no`)
and (`d`.`dept_no` = 'd001'))"
},
{
"transformations_to_nested_joins": {
"transformations": [
"parenthesis_removal"
],
"expanded_query": "/* select#1 */ select `e`.`first_name` AS
`first_name`,`e`.`last_name` AS `last_name`,`a`.`from_date` AS
`from_date` from `dept_manager` `a` join `departments` `d` join
`employees` `e` where ((`a`.`dept_no` = `d`.`dept_no`) and (`a`.`emp_no`
= `e`.`emp_no`) and (`d`.`dept_no` = 'd001'))"
}
}
]
}
#+END_EXAMPLE

* join3_03
- [[file:join3_03_opt.sql][sql]] | [[file:join3_03_opt.sql.json][opt_trace]]
Expand All @@ -44,3 +95,18 @@
where
a.dept_no = d.dept_no and a.emp_no = e.emp_no and d.dept_no = 'd001';
#+END_SRC
- preparation
#+BEGIN_EXAMPLE
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `e`.`first_name` AS
`first_name`,`e`.`last_name` AS `last_name`,`a`.`from_date` AS `from_date`
from `dept_manager` `a` join `departments` `d` join `employees` `e` where
((`a`.`dept_no` = `d`.`dept_no`) and (`a`.`emp_no` = `e`.`emp_no`) and
(`d`.`dept_no` = 'd001'))"
}
]
}
#+END_EXAMPLE

0 comments on commit 6369386

Please sign in to comment.