bp Interview Question

Join table with SQL query