How to compare two tables in one database

I am trying to compare two tables A,B from same data base. Table A has Reference datapoint(s). Table B has calculated datapoint(s). I wanna compare ref time with calculated time and plot difference in a stacked barchart, or a graph etc.