Question:
Creating a music searching database. XML or SQL?
Josh
2010-11-14 18:03:27 UTC
For my website I want to create a small database with my favorite albums and musicians. I want the user to be able to search this database and/or narrow their results using check boxes and searches (similar to how shopping websites allow you to narrow your results by size, color, price, etc. like eBay or Best Buy). For this kind of functionality, do I have to use SQL or can I do the same with XML? Any suggestions?
Three answers:
Chris C
2010-11-14 19:10:53 UTC
You can use either SQL or XML.

- To know how to find records that match in XML, you will also have to know XSLT to transform the data in the fashion that you want, and at the same time using XSLT, you can use the transformation portion of that technology to change how it looks on the user's computers (similar to what CSS does for HTML).

- SQL can be simpler, because there's a quick standard such as "SELECT FROM WHERE ...", and you just receive the information by records that you can then loop through to display the information to the user. You can also use SQL to generate XML (at least the larger ones like Oracle, SQL Server, MySQL support the XML output.



If it's a small database, it is pretty nice to simply use XSLT and thus the entire piece of data is on the users computer, your stylesheet (XSLT) would just have to filter it in a different way.



The places you mention (eBay and Best Buy) use SQL as their backend, because they have a vast amount of information that can be searched or presented to the users (if they have the access of course).



So, in closing I would suggest that you use the technology that you are already famaliar with. If that is SQL and HTML/CSS, then use it (the learning curve isn't as hard), or if you are already famaliar with XML/XSLT, then go with that technology.

Good luck in your endeavor.



ETA: I do agree in part with "TheMadProfessor" above (now that I edited my post). XML is not a database query language, it is however fundamentally a database that can be queried/filtered using XSLT. Much like Oracle is the database, but SQL is a query language for the database.
TheMadProfessor
2010-11-15 08:44:06 UTC
Strictly speaking, XML is not a database query language while SQL is. If you will be doing queries of any complexity at all, I'd use SQL. If you're mainly looking at XML for portability purposes, quite a few of the RDBMS now in use can generate resultsets in XML.
anonymous
2016-10-27 13:57:58 UTC
you want to both: connect the releases table to the artist table by artist id. or in simple terms get rid of the releases table from the question; relying on what you attempt to retrieve. do you decide on each and each and every of the releases for Neyo, or in simple terms files about Neyo and under no circumstances something about his releases.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...