First off, apologies, wasn't replying directly to you -- confusing mess Hashnode is with TWO text entry boxes on every page; still adjusting. I'm used to just scrolling to the bottom and entering a reply.
But really I'm not sure I understood the OP's question or what you were doing with that massively complex create. Either I completely misunderstood what was being asked, or you guys are MASSIVELY overthinking this.
I think we need more clarification from Aqueel Aboobacker on just what it is he's doing with that select. Is that to select results from a query, or to store that value in the table.
Either way I'd be handling 0 as a special case in the QUERY, not the table.
If it's to query values (php example)
$baseQuery = '
SELECT *
FROM whatever
';
if ($_POST['routes'] == 0) $stmt = $db->prepare($baseQuery);
else {
$stmt = $db->prepare($baseQuery . '
WHERE routes = :routes
OR routes = 0
');
$stmt->bindParam(':routes', $_POST['routes']);
}
$stmt->execute();
Then you just store the zero. "OR" being the magic part of the solution. Then you don't have to screw around with the table structure at all. Just treat index 0 as all.