The nurse forgot that the doctor was sleeping in his office.
we can say that the prepositional phrase “in his office” and the clause “that the doctor was sleeping in his office” are both “constituents” of the whole sentence.
• The two constituents are not on the same level of analysis: The first step in analyzing the sentence is to divide it into two clauses: the main clause (equivalent to the whole sentence) and the subordinate clause “the doctor was sleeping in his office.” On the second level, however, we can divide the subordinate clause into the phrases which are its components: the noun phrase, “the doctor,” the verb phrase,  “was sleeping,” and the prepositional phrase, “in his office.” Because the clause, “that the doctor was sleeping in his office” is arrived at in the first stage of analyzing the sentence (“immediately” in other words) it is called an “immediate constituent” of the sentence. Because the noun phrase and the prepositional phrase inside that clause are not arrived at until the second stage, although they are constituents, they are not immediate constituents.
• There is a good reason for singling out immediate constituents as a sub-group of constituents: It makes it possible to describe sentences as those grammatical units that have clauses as their immediate constituents, to describe clauses as units that have phrases as their immediate constituents and phrases as units that have words as their immediate constituents. Such descriptions would not be accurate if we were speaking generally of constituents because, for example, sentences have words and phrases as (ordinary) constituents as well as having clauses as their immediate constituents.
• It is also necessary to distinguish between “unitary” and non-unitary constituents. A constituent is unitary if it has only one part. For example, if a sentence has just one main clause (as is the case with simple and complex sentences) then that one clause is the unitary constituent of the sentence; similarly if a phrase has just one word, then that single word is the unitary constituent of the phrase.
(1) Talk of grammatical units with unitary constituents (one-clause sentences and one-word phrases) may seem to complicate things in a counter-intuitive way; without this terminology however, the view of grammatical analysis being described here would be impossible.
(2) The possibility of embedding—and in particular the possibility of embedding relative clauses in noun phrases—complicates this method of grammatical analysis because it constitues an exception to the principle that the constituents of a grammatical unit belong to the next lower level of the grammatical hierarchy. Embedding is/will be discussed in another entry of the Grammar Glossary.