Yeah, list comprehensions are isomorphic to query languages. There's at least one database (Mnesia) and three database abstraction libraries (HaskellDB, SchemeQL, SQLAlchemy) that exploit this.
That does not mean that databases are useless. Your [(customer.name, customer.phone) for customer in customers for sale in sales if sale.customer_id = customer.customer_id and sale.product_id in defective_product_list and sale.date.month in (10, 11, 12) and customer.lifetime_sales > 10000 and customer.state in ('CA', 'WA', 'OR')] isn't going to help much if you have thousands of customers and millions of sales.
The examples I cited are real. (When you're in the trenches, you don't need to make them up.) The database has 1,692,438 Customers and 7,823,356 Sales Orders. All 4 questions had subsecond response. But not using a single SQL statement as you suggest. Using a combination of resources: indexes, stored procedures, common functions, and other code, applied exactly as needed. And a RDBMS.
Remember, this is a discussion of relational databases, not SQL. 2 different issues.
HaskellDB would be so awesome if it actually worked. Every time I've tried to use it, though, the backend has choked on some piece of the generated SQL.
When I tried it, I didn't even get to that point. It choked on installation; I couldn't get it working with MySQL, then I tried with PostGres and it couldn't find pg_config or something silly like that, then I gave up. (In hindsight, I was probably just missing the dev headers or something.)
That was early 2005, though. It may be better now.
That does not mean that databases are useless. Your [(customer.name, customer.phone) for customer in customers for sale in sales if sale.customer_id = customer.customer_id and sale.product_id in defective_product_list and sale.date.month in (10, 11, 12) and customer.lifetime_sales > 10000 and customer.state in ('CA', 'WA', 'OR')] isn't going to help much if you have thousands of customers and millions of sales.