Unifying flight formats II
In the previous exercise, you used CONCAT(), REPLICATE(), and LEN(). You got every register with more than 100 delays from the flight_statistics table. In a unique column, you concatenated the carrier_code, registration_code, and airport_code, having a similar format to this one: "AA - 0000119, JFK".
In this exercise, you will solve the same problem again, this time using the FORMAT() and CONCAT() functions together.
Bu egzersiz
Cleaning Data in SQL Server Databases
kursunun bir parçasıdırEgzersiz talimatları
- Concatenate the
carrier_code, formattedregistration_code, andairport_codetogether using the appropriate function. - Format the
registration_codecolumn while casting it as an integer. - Filter registers with more than 100 delays.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
SELECT
-- Concat the strings
___(
carrier_code,
' - ',
-- Format the code
___(___(registration_code AS INT), '0000000'),
', ',
airport_code
) AS registration_code
FROM flight_statistics
-- Filter registers with more than 100 delays
WHERE ___ > 100