You don't say RDBMS.
The following works in SQL Server 2008
;WITH searchterms as
(
SELECT display_term, occurrence
FROM sys.dm_fts_parser('"a master degree"',1033,NULL,0)
)
SELECT MIN(ID) AS StartRange, MAX(ID) AS EndRange
FROM data
JOIN searchterms on data.Words =searchterms.display_term
GROUP BY ID-occurrence
HAVING COUNT(*) = (SELECT COUNT(*) FROM searchterms)
Returns
StartRange EndRange
----------- -----------
3 5
The sys.dm_fts_parser
bit could be replaced with a split function in previous versions that returns the following
display_term occurrence
------------------------------ -----------
a 1
master 2
degree 3