== Why is this an issue?

include::../description.adoc[]

=== Noncompliant code example

[source,sql]
----
SELECT c.id, c.name, o.id, o.item_id, o.item_quantity
  FROM ORDERS o, CUSTOMERS c; -- Noncompliant; no JOIN condition at all

SELECT c.id, c.name, o.id, o.item_id, o.item_quantity
  FROM ORDERS o
  JOIN CUSTOMERS c ON o.customer_id = o.id; -- Noncompliant; no condition related to CUSTOMERS

SELECT f.name, d.title, l.*
  FROM FOLDERS f, DOCUMENTS d, DOC_LINES l -- Noncompliant; missing at least one condition related to DOC_LINES
 WHERE f.id = d.folder_id;
----

=== Compliant solution

[source,sql]
----
SELECT c.id, c.name, o.id, o.item_id, o.item_quantity
  FROM ORDERS o, CUSTOMERS c
 WHERE o.customer_id = c.id; -- Compliant

SELECT c.id, c.name, o.id, o.item_id, o.item_quantity
  FROM ORDERS o
  JOIN CUSTOMERS c ON o.customer_id = c.id; -- Compliant

SELECT f.name, d.title, l.*
  FROM FOLDERS f, DOCUMENTS d, DOC_LINES l
 WHERE f.id = d.folder_id
   AND d.id = l.document_id; -- Compliant
----
ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

endif::env-github,rspecator-view[]
