I am currently using a XML data type in a SQL table
My datatable looks like this
Id | Name | Surname | Title | Location | Artist |
-------------------------------------------------------
1 | xxx | abc | def | London | XML |
2 | xxx | abc | def | Oslo | XML |
3 | xxx | abc | def | New York | XML |
My XML file looks like this
<song category="gaming">
<title>Valentine's Day</title>
<artist-main>Fatfinger</artist-main>
<artist-featured>Slimthumb</artist-featured>
<year>2013</year>
<price>29.99</price>
<album>Gamestain</album>
<albumimg>http://download.gamezone.com/uploads/image/data/875338/halo-4.jpg</albumimg>
<songurl>http://www.youtube.com/watch?v=-J0ABq9TnCw</songurl>
Now to get the record depending upon the artist I am using a query which is
SELECT
Id, Name, Surname, Title
FROM
DATA
WHERE
Artist Like '%Fatfinger%' -- (this is user input)
Is this is the right approach in querying XML data in SQL or are there any built in functions in SQL that can handle XML. I am new to SQL.