graph mining using SQL