Please answer by using MYSQL A journey from Tussenwater to Parkweg travels in on
ID: 3747364 • Letter: P
Question
Please answer by using MYSQL
A journey from Tussenwater to Parkweg travels in one zone, as does a journey from Blaak to Blijdorp Travelling from Rodenrijs to Marconiplein covers two zones, with the start station in Northern Line Zone 2 and finishing within Zone 1. A trip from Centraal to Capelsebrug (Zone 1 to Eastern Line Zone 2) also covers two zones. Some trips travel through three zones, for example, Capelsebrug to Rodenrijs, which travels through Eastern Line Zone 2, Zone 1 and Northern Line Zone 2 (three zone:s in total). Cost () Zones 1 Zone 2 Zones 3 Zones 3 65 8 Table 1: Rotterdam Metro FaresExplanation / Answer
I'm curious about zone column in stattion table
If i would consider it as a Prefix for Zone
Select c.username,
( case
when j.startStationID == j.endStationID
Then 1
WHEN j.startStationID <> j.endStationID
THEN 2
ELSE 0
) As 'Fare'
from customer c
INNER JOIN journey j ON j.customerID = c.customerID;
See I have answered for two Time Zones. I will Re-Edit it for 3 Zones.