Datasheet
<Product ProductId=”9F71EFA0-9790-11DA-A72B-0800200C9A66”
ProductName=”Gadget” ProductCost=”20.0000”
ProductCategoryId=”914FC5A0-9790-11DA-A72B-0800200C9A66”/>
This is not a complete, legal XML document as it stands (it has multiple root elements for one thing), but
it would be easy to turn it into one.
If you are writing applications that must generate XML from data stored in a database, the
FOR XML
clause can speed things up dramatically — because by using the right queries it would be possible to
avoid having to do any further data processing outside of SQL Server.
SQL Server also provides ways to insert rows into tables directly from XML documents and even has the
capability to return XML data in response to web requests. Again, these are things that you will see later
in the book, as they become pertinent.
Summary
In this chapter, you looked at the basics of databases, including how they are structured and how to
access the data contained in them. You have also learned about the additional features of databases and
how to use SQL to manipulate databases, and you saw a quick summary of XML and how it fits in to the
database world.
Specifically, you have learned:
❑ What a database is
❑ What terminology to use when referring to databases
❑ How relational databases work, and what makes them useful
❑ What the difference is between relational and object-oriented database management systems
❑ What functionality databases offer above and beyond storing data
❑ What the differences are between many of the available DBMSes
❑ What SQL is
❑ How to retrieve, add, delete, and update data in databases using a variety of SQL queries
❑ What else is possible using more advanced SQL syntax
❑ What XML is
❑ How it is possible to use XML data in combination with databases
In the next chapter, you see how C# can be used to interact with SQL Server 2005 Express Edition, and
you start to experiment with sample applications.
33
Database Fundamentals
44063c01.qxd:WroxBeg 9/12/06 10:31 PM Page 33