There are two basic types of foundations: shallow and deep. Shallow foundations are used when the soil directly below the building can bear the weight, while deep foundations are needed when the near-surface soil conditions are unsuitable and the structure must reach deeper soils. Within shallow foundations there are slab on grade, crawl spaces, and basements, with choices based on factors like high water tables. Deep foundations include pile driving and mat slabs to reach bedrock or firmer soils below poor near-surface conditions.