Pervasive information systems give an overview of what digital environments should look like in the future. From a data-centric point of view, traditional databases have to be used alongside with non-conventional data sources like data streams, services and events. In this paper, we tackle the definition of continuous queries combining standard relations, data streams and services in a declarative language extending SQL. We first define virtual tables with binding patterns as a way to get a unified view of the pervasive environment. Relations, data streams and services can be homogeneously queried using a SQL-like language, on top of which query optimization can be performed. We also introduce a new clause defining the optimizing criteria to dynamically choose the best way to handle each event. R