Title: Great Wall of China
Content:  The Great Wall of China is a series of fortifications that were built across the historical northern borders of ancient Chinese states and Imperial China as protection against various nomadic groups from the Eurasian Steppe. Several walls were built from as early as the 7th century BC, with selective stretches later joined together by Qin Shi Huang (220–206 BC), the first emperor of China. Little of the Qin wall remains. Later on, many successive dynasties built and maintained multiple stretches of border walls. The best-known sections of the wall were built by the Ming dynasty (1368–1644). Apart from defense, other purposes of the Great Wall have included border controls, allowing the imposition of duties on goods transported along the Silk Road, regulation or encouragement of trade and 
Title: History of the Great Wall of China
Content:  The history of the Great Wall of China began when fortifications built by various states during the Spring and Autumn (771–476BC) and Warring States periods (475–221BC) were connected by the first emperor of China, Qin Shi Huang, to protect his newly founded Qin dynasty (221–206BC) against incursions by nomads from Inner Asia. The walls were built of rammed earth, constructed using forced labour, and by 212 BC ran from Gansu to the coast of southern Manchuria. Later dynasties adopted different policies towards northern frontier defense. The Han (202BC – 220AD), the Northern Qi (550–574), the Jurchen Jin (1115-1234), and particularly the Ming (1369–1644) were among those 
Title: Great Wall of China
Content:   The Chinese were already familiar with the techniques of wall-building by the time of the Spring and Autumn period between the 8th and 5th centuries BC. During this time and the subsequent Warring States period, the states of Qin, Wei, Zhao, Qi, Han, Yan, and Zhongshan all constructed extensive fortifications to defend their own borders. Built to withstand the attack of small arms such as swords and spears, these walls were made mostly of stone or by stamping earth and gravel between board frames.  King Zheng of Qin conquered the last of his opponents and unified China as the First Emperor of the Qin dynasty ("Qin Shi Huang") in 221 BC. Intending to impose centralized rule and prevent the resurgence of feudal lords, he ordered the destruction of the sections of 
Title: History of the Great Wall of China
Content:  as Changcheng (長城) – literally "long walls", but often translated as "Great Wall" – were mostly constructed of tamped earth, with some parts built with stones. Where natural barriers like ravines and rivers sufficed for defence, the walls were erected sparingly, but long fortified lines were laid where such advantageous terrains did not exist. Often in addition to the wall, the defensive system included garrisons and beacon towers inside the wall, and watchtowers outside at regular intervals. In terms of defence, the walls were generally effective at countering cavalry shock tactics, but there are doubts as to whether these early walls were actually defensive 
Title: History of the Great Wall of China
Content:  Yanmen Pass, with a line of fortifications and beacon fires stretching from Pingcheng County (present-day Datong) through the valley of the Sanggan River to Dai County, Shanxi. By 38 AD, as a result of raids by the Xiongnu further to the west against the Wei River valley, orders were given for a series of walls to be constructed as defences for the Fen River, the southward course of the Yellow River, and the region of the former imperial capital, Chang'an. These constructions were defensive in nature, which marked a shift from the offensive walls of the preceding Emperor Wu and the rulers of the 
Title: Defensive wall
Content:  Large rammed earth walls were built in ancient China since the Shang Dynasty (c. 1600–1050BC), as the capital at ancient Ao had enormous walls built in this fashion (see siege for more info). Although stone walls were built in China during the Warring States (481–221BC), mass conversion to stone architecture did not begin in earnest until the Tang Dynasty (618–907 AD). Sections of the Great Wall had been built prior to the Qin Dynasty (221–207BC) and subsequently connected and fortified during the Qin dynasty, although its present form was mostly an engineering feat and remodeling of the Ming Dynasty (1368–1644AD). The large walls of Pingyao serve as one example. Likewise, the walls of the Forbidden City in Beijing were established in the early 15th century by the Yongle Emperor. According to Tonio Andrade, the immense thickness of Chinese city walls prevented larger cannons from being developed, since even industrial era artillery had trouble breaching Chinese walls.
Title: Fortification
Content:   Large tempered earth (i.e. rammed earth) walls were built in ancient China since the Shang dynasty (c. 1600–1050 BC); the capital at ancient Ao had enormous walls built in this fashion (see siege for more info). Although stone walls were built in China during the Warring States (481–221 BC), mass conversion to stone architecture did not begin in earnest until the Tang dynasty (618–907 AD). The Great Wall of China had been built since the Qin dynasty (221–207 BC), although its present form was mostly an engineering feat and remodelling of the Ming dynasty (1368–1644 AD). In addition to the Great Wall, a number of Chinese cities also employed the use of defensive walls to defend their cities. Notable Chinese city walls include the city walls of Hangzhou, Nanjing, the Old City of Shanghai, Suzhou, Xi'an and the walled villages of Hong Kong. The famous walls of the Forbidden City in Beijing were established in the early 15th century by the Yongle Emperor. The Forbidden City made up the inner portion of the Beijing city fortifications.
Title: History of the Great Wall of China
Content:  Frontier policy under the Tang dynasty reversed the wall-building activities of most previous dynasties that had occupied northern China since the third century BC, and no extensive wall building took place for the next several hundred years. Soon after the establishment of the Tang dynasty, during the reign of Emperor Taizong (r.626–649), the threat of Göktürk tribesmen from the north prompted some court officials to suggest drafting corvée labourers to repair the aging Great Wall. Taizong scoffed at the suggestion, alluding to the Sui walls built in vain: "The Emperor Yang of Sui made the people labor to construct the Great Wall in order to defend against the Turks, but in the end this was 
Title: Great Wall of China
Content:  control of immigration and emigration. Furthermore, the defensive characteristics of the Great Wall were enhanced by the construction of watchtowers, troop barracks, garrison stations, signaling capabilities through the means of smoke or fire, and the fact that the path of the Great Wall also served as a transportation corridor. The frontier walls built by different dynasties have multiple courses. Collectively, they stretch from Liaodong in the east to Lop Lake in the west, from the present-day Sino–Russian border in the north to Tao River (Taohe) in the south; along an arc that roughly delineates the edge of the Mongolian steppe; spanning over 20000 km in total. Today, the defensive system of the Great Wall is generally recognized as one of the most impressive architectural feats in history.
Title: History of the Great Wall of China
Content:  As Northern Wei became more economically dependent on agriculture, the Xianbei emperors made a conscious decision to adopt Chinese customs, including passive methods of frontier defence. In 423, a defence line over 2,000 li (1080 km) long was built to resist the Rouran; its path roughly followed the old Zhao wall from Chicheng County in Hebei Province to Wuyuan County, Inner Mongolia. In 446, 100,000 men were put to work building an inner wall from Yanqing, passing south of the Wei capital Pingcheng, and ending up near Pingguan on the eastern bank of the Yellow River. The two walls formed the basis of the double-layered Xuanfu–Datong wall system that protected Beijing a thousand years later during the Ming dynasty. The Northern Wei also built Six Frontier Towns to protect the Hetao meander against northern invasions.

Question: who was the great wall of china built to defend against?
Answer: nomads from Inner Asia.
nomads from Inner Asia.