We now have covered the traditional ways of returning sets of structured data from functions. We will now start with the more interesting part. Other methods to pass around complex data structures have evolved in the world.
In the real world, most of the data is not in a single table and the database is not the main thing that most programmers focus on. Often, they don't even think about it at all, or at least they would rather not think about it.
If you are a database developer who works on the database side of things, it is often desirable to talk to the clients (be it web or application developers as your client, or programs as database clients) in the language they speak. Currently, the two most widely spoken data languages by the web applications and their developers are XML and JSON.
Both XML and JSON are text-based data formats, and as such, they can be easily saved into fields of the type text...