MulaiMulai sekarang secara gratis

Matching urls

In this lesson you learned that SQL Server provides the LIKE operator, which determines if a string matches a specified pattern.

You need to verify the URLs of the official sites of every series. You prepare a script that checks every official_site value from the series table to analyze possible wrong URLs.

To make it easier, suppose that the format of the URLs you have to validate must start with 'www.', although we know that there are URLs that have other beginnings.

Latihan ini adalah bagian dari kursus

Cleaning Data in SQL Server Databases

Lihat Kursus

Petunjuk latihan

  • Select the URLs of the official sites.
  • Get the URLs that don't match the pattern.
  • Write the pattern.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

SELECT 
	name,
    -- URL of the official site
	___
FROM series
-- Get the URLs that don't match the pattern
WHERE official_site ___ ___
	-- Write the pattern
	'___'
Edit dan Jalankan Kode