On 06/09/2013 07:42 AM, Alexander Gataric wrote: > I need a sample database and hard practice SQL questions (multiple joins, window functions, subqueries, CTEs) to write ad hoc queries or perform database tasks. Any suggestions are welcome. Thanks in advance. One option would be to look through Stack Overflow problems tagged [postgresql] and assemble a list. All user-generated content on Stack Overflow is licensed under cc-wiki with attribution required (see the footer): http://creativecommons.org/licenses/by-sa/3.0/ http://blog.stackoverflow.com/2009/06/attribution-required/ so you're free to take things like sample data people have posted and use them in the DB so long as you identify the sources of what you use and make it available to others under the same terms. Additional tags like [crosstab], [window-functionss], [pivot], [subquery], [join], [common-table-expression] etc will sometimes help you find more - in cases where it was primarily about subqueries, CTEs, etc rather than answers just incidentally using them. Don't rely solely on these tags, you'll want to do a bit of searching too. It would be quite valuable to have such a collection. I'm not aware of anything along those lines that already exists for PostgreSQL - a wholly artificial demo data DB for SQL problems or one assembled from user examples. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general