BaşlayınÜcretsiz Başlayın

Combining cities and states using +

In this lesson, you learned how to combine columns into one.

The clients table has one column, city, to store the cities where the clients live, and another column, state, to store the state of the city.

| client_id | client_name | client_surname | city      | state    |
|-----------|-------------|----------------|-----------|----------|
| 1         | Miriam      | Antona         | Las Vegas | Nevada   |
| 2         | Astrid      | Harper         | Chicago   | Illinois |
| 3         | David       | Madden         | Phoenix   | Arizona  |
| ...       | ...         | ...            | ...       | ...      |

You need to combine city and state columns into one, to have the following format: 'Las Vegas, Nevada'.

You will use + operator to do it.

Bu egzersiz

Cleaning Data in SQL Server Databases

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

SELECT 
	client_name,
	client_surname,
    -- Concatenate city with state
    ___ + '___' + ___ AS city_state
FROM clients
Kodu Düzenle ve Çalıştır