<?php

$SQL = "create view view_subscriptions as
         
         select subscriptions.*,
                    DATE_FORMAT(subscriptions.subscription_created, '%c/%e/%Y %l:%i %p') AS subscription_created_verbose,
                    DATE_FORMAT(subscriptions.subscription_changed, '%c/%e/%Y %l:%i %p') AS subscription_changed_verbose,

                    service_levels.dropdown_value AS subscription_service_level_verbose,
                    markets.dropdown_value  AS subscription_market_verbose,

                    CONCAT_WS(' ', subscriptions.subscription_title, service_levels.dropdown_value, markets.dropdown_value) AS subscription_full_title
                    
                FROM subscriptions
                
                LEFT JOIN dropdowns as service_levels
                    ON service_levels.dropdown_serial = subscriptions.subscription_service_level
                    
                LEFT JOIN dropdowns markets
                    ON markets.dropdown_serial = subscriptions.subscription_market";
?>