(Reuters) - McGraw Hill Financial Inc (>> McGraw Hill Financial Inc), parent of ratings agency the Standard & Poor's, said it would buy data company SNL Financial for about $2.23 billion, and its shares fell nearly 6 percent.

McGraw Hill, which also reported a higher-than-expected second-quarter profit on Monday, said the deal would strengthen its S&P Capital IQ data analytics unit, particularly in providing information on banking and insurance.

However, UBS analysts wrote in a note that investors might not have hoped for a major acquisition for Capital IQ, "as opposed to higher-margin and lower-competition areas such as rating and indices."

McGraw Hill's rating and index units have accounted for the majority of earnings in the past few quarters.

The company maintained its full-year earnings forecast of between $4.35 and $4.45 per share, excluding special items, despite expectations that the deal would reduce profit by 5 cents to 7 cents.

Tax benefits of about $550 million will mitigate the financial impact of the acquisition, the company said in a statement.

New York-based McGraw Hill said it expected the deal to add to diluted earnings per share in 2016, excluding amortization and special items.

SNL Financial, owned by private equity firm New Mountain Capital LLC, has about 3,000 employees in 10 countries.

In the second quarter, McGraw Hill's earnings per share from continuing operations jumped 17 percent to $1.21, excluding gains from legal settlements and the sale of a construction business asset.

Analysts on average had expected $1.13 a share, according to Thomson Reuters I/B/E/S.

Revenue fell 1 percent at Standard & Poor's Ratings Services, the company's biggest unit, but rose 11 percent at S&P Dow Jones Indices.

S&P Capital IQ revenue rose 6 percent to $324 million.

Total revenue rose 3 percent to $1.34 billion.

McGraw Hill shares were down 5.6 percent at $99.69 in afternoon trading.

Rival Moody's Corp (>> Moody's Corporation) reported a higher-than-expected quarterly profit on Friday, benefiting from strong growth in its analytics business.

Thomson Reuters Corp (>> Thomson Reuters Corp) competes with McGraw Hill in providing information on financial and commodities markets.

Evercore Partners Inc (>> Evercore Partners Inc.) and Goldman Sachs Group Inc (>> Goldman Sachs Group Inc) acted as financial advisors and Wachtell, Lipton, Rosen & Katz and Clifford Chance LLP were legal advisors to McGraw Hill Financial. SNL Financial received legal counsel from Fried, Frank, Harris, Shriver & Jacobson LLP.

(Reporting by Richa Naidu and Neha Dimri in Bengaluru; Editing by Saumyadeb Chakrabarty and Lisa Von Ahn)