# Miscellaneous > Structured Query Language (SQL) >  Query Containment

## PeterFranko

Hi guys, I need your help, please.

Is "Query Containment" the same as "Nested Query"? If not, could you give me an easy example of what "Query Containment" is?

Thank you. Peter

----------


## SpywareDr

Any help here? https://courses.cs.washington.edu/co...ve-queries.pdf

----------


## PeterFranko

Hi SpywareDr,
 this is a really great lecture, thank you. However, it is written in such a technical language, that I was really struggling to understand. Somehow at the end I still do not know the answer. The problem is that we were given a small task:
 "Show a practical example of query containment." And my colleagues started giving examples of nested queries and SELECT inside another SELECT. Now I have a feeling that these topics are not related and that my colleagues are wrong. Are they? Or maybe me?
 Tank you. Peter.

----------


## SpywareDr

Encyclopedia of Database systems > *Query Containment*


> Definition
> 
> One query is contained in another if, independent of the values of the stored data (that is, database), the set of answers to the first query on the database is a subset of the set of answers to the second query on the same database. 
> 
> A formal definition of containment is as follows: _[...continues...]_

----------

