Connecting the tables