What is the relationship between Cao Cao and Xia?

It's a brother-in-law relationship.

Xia is the wife and sister of Cao Cao after the courtiers of the Western Han Dynasty. Cao Cao was involved in a case in his hometown, and Xia took responsibility for it. Later, Cao Cao tried to save him and avoided the disaster.

In the early days, with Cao Cao's conquest, the battle of Guandu transported grain and grass for Cao Cao's army, and the generals of the army successively put down Chang Yi, Xu He, Xu Lei and Shang Yang. Later, he led the army to conquer Guanzhong and Liangzhou, beheaded Liang Xing, pursued Ma Chao, defeated Han Sui, destroyed Song Jian, and swept away the foreign forces such as Qiang, Bian and Tu.

After Zhang Lu surrendered to Cao Cao, Xia stayed in Hanzhong and refused to treat Liu Bei for more than a year. He was attacked by Liu Bei's Huang Zhong in Dingjun Mountain and died in battle.

Extended data:

Xia followed Cao Cao and fought bravely. He was Sima, the captain of other departments, and later he was promoted to Liu Chen and Yingchuan. Jian 'an five years (200 years), Xia as the overseer. In the sixth year of Jian 'an, Xiahou Yuan and Zhang Liao were ordered to lead the troops out to attack Chang Yi and pay homage to a captain of Canon Army. In the 16th year of Jian 'an, Han Sui and Ma Chao were recruited from Cao Cao.

In December of the same year, Cao Cao led the army eastward, leaving Governor Xia and guarding Chang 'an. He defeated Xiong Liu who was entrenched in Zhong Nanshan and surrendered his people; He also attacked Shu County (now Huxian County, Shaanxi Province) and killed Ma Chao's remaining party.

In order to pacify the merits of Guanzhong and seal Bo Changge. In the eighteenth year of Jian 'an, Ma Chao belonged to Longyou, surrounded Zheng Ji (now northwest of Tianshui City, Gansu Province) and ruled Liangzhou. Xia led the army to save, and Jicheng was broken. Ma Chao led his troops out of the city of Hebei for more than 200 miles to meet him. The army was unfavorable, rebellion broke out, and Xia withdrew.

After Ma Chao surrounded Qishan, Xia came to the rescue unexpectedly and quickly. Ma Chao failed, collected all his military equipment and recovered counties in Gansu. Then, Xia marched into Qin (now Qin 'an County, Gansu Province) and defeated Han Sui.

In the 19th year of Jian 'an, Xia led an army to conquer (now northeast of Linxia, Gansu) and slay Song Jian. Later, Zhang He was sent to cross the Yellow River and enter Xiaohuangzhong (now the land on both sides of Huangshui River in the northeast of Qinghai) to surrender to the Qiang people in Hexi and pacify Longyou. To this end, Cao Cao ordered praise, saying that Xia was invincible like a tiger.

After Cao Cao pacified Zhang Lu, he took Xia as the general and made him defend Hanzhong. In the 23rd year of Jian 'an, Liu Bei entered Yangpingguan, but Xia and Liu Bei refused for more than a year. In the spring of the following year, Liu Beinan crossed the Mianshui River and set up Dingjun Mountain, commanding himself. Xia was attacked and beheaded by Liu Bei's subordinate Huang Zhong.

Baidu encyclopedia-Xia