In SQL Server Data Services (SSDS) an authority stores containers, and a container stores entities.

When you query the service, you first choose the scope over which you wish to query, and then you provide a query expression to filter the flexible entities in the scope. The syntax that begins the query operation is (?q=). For example, to query for entities, specify a container scope, followed by the query expression: 

     https://{authority}.data.beta.mssds.com/v1/{container}?q={query}  

You cannot retrieve entity objects today by searching at the authority level, the widest scope for any entity search is the Container. There is no cross-container search (in the current implementation).

However, if you want to query for container metadata, specify an authority scope, followed by the query expression:

     https://<authority_id>.data.beta.mssds.com/v1/?q={query}

The Query Language 

The LINQ-like syntax of the query language that is supported in this release is as follows:

          from e in entities [where condition] select e

The query iterates over the set of flexible entities in the specified scope and returns only those items that satisfy the specified condition in the optional where clause. In the where clause, you can specify a simple condition or a compound condition (multiple conditions combined by using logical operators). 

The syntax allows you to distinguish between querying metadata (system) properties and querying flexible properties (anything you added). When you query metadata properties, you use the '.' notation. In the following query, the condition in the where clause references the Id metadata property. The query retrieves a Flexible Entity with a specific Id value.

          from e in entities where e.Id == "someId" select e

The flexible properties are stored in the Properties collection of the entity. When you query over these properties, you specify the property name by using Indexer syntax. The following query retrieves all entities whose Age flexible property value is 32:

 
          from e in entities where e["Age"] == 32 select e
 
You can tie together multiple expressions using the && (AND), || (OR), and ! (NOT) logical operators.  Precedence can be set using parentheses ().