וַיִּתְחַתֵּ֣ן שְׁלֹמֹ֔ה אֶת־פַּרְעֹ֖ה מֶ֣לֶךְ מִצְרָ֑יִם וַיִּקַּ֣ח אֶת־בַּת־פַּרְעֹ֗ה וַיְבִיאֶ֙הָ֙ אֶל־עִ֣יר דָּוִ֔ד עַ֣ד כַּלֹּת֗וֹ לִבְנ֤וֹת אֶת־בֵּיתוֹ֙ וְאֶת־בֵּ֣ית יְהוָ֔ה וְאֶת־חוֹמַ֥ת יְרוּשָׁלִַ֖ם סָבִֽיב׃
At si Solomon ay nakipag-ugnayan sa pamamagitan ng pag-aasawa kay Faraon na hari ng Egipto; kinuha niya ang anak na babae ni Faraon at dinala siya sa Lungsod ni David, hanggang sa matapos niyang itayo ang kanyang sariling bahay, ang Bahay ng Walang-Hanggan, at ang pader sa palibot ng Jerusalem.
Rashi
Shlomo became the son-in-law. As long as Shim’i, his teacher, was alive, he did not enter into marriage [with Pharaoh’s daughter]. From here, [our Sages derived and] declared, that a person should always live in the vicinity of his teacher.1Based on the juxtaposition of Shimi’s death and Shlomo’s marriage to Pharaoh’s daughter. See Maseches Berachos 8a.2In order to remain under his teacher’s guidance and influence.
Rashi
Until he finished building, etc. And afterwards he built a house for her.3Alternatively, after he finished building the Beis Hamikdosh, Shlomo moved Pharaoh’s daughter out of the City of Dovid which had become sanctified by the presence of the Ark.—Radak