Професионална програма
Loading...
ktodorov avatar ktodorov 42 Точки

[DB-Fundamentals - Table Relations] - Problem 13. Employee 24

Здравейте,

Някой може ли да ми каже защо следното решение не минава в judge:

SELECT e.employee_id, e.first_name,
CASE
	WHEN p.start_date > '20050101' THEN NULL
	ELSE p.name
	END AS project_name
FROM employees AS e
INNER JOIN employees_projects AS ep
ON e.employee_id = ep.employee_id
INNER JOIN projects AS p
ON ep.project_id = p.project_id
WHERE e.employee_id = 24

Когато реша задачата по този начин:

SELECT e.employee_id, e.first_name, p.name AS project_name
FROM employees AS e
INNER JOIN employees_projects AS ep
ON e.employee_id = ep.employee_id
LEFT OUTER JOIN projects AS p
ON ep.project_id = p.project_id
AND p.start_date < '20050101'
WHERE e.employee_id = 24

judge ми приема решението за вярно.

Резултатът от двете решения е идентичен, защо първото се отчита от judge като грешно?

Поздрави

Тагове:
1
Module: Java DB
vilievkofata avatar vilievkofata 2 Точки
SELECT employees.employee_id, first_name, IF(projects.start_date >= '2005-01-01', NULL, projects.name)
FROM employees
         JOIN employees_projects on employees.employee_id = employees_projects.employee_id
         JOIN projects on employees_projects.project_id = projects.project_id
WHERE employees.employee_id = 24
ORDER BY projects.name;

 

0