code: def delete_joined_table_sql(qualified_name, removing_qualified_name, primary_key):
      
  
      condition_template = 't.{}=d.{}'
      where_clause = ' AND '.join(condition_template.format(pkey, pkey)
                                  for pkey in primary_key)
      delete_statement = (
          'DELETE FROM {table} t'
          ' USING {delete_table} d'
          ' WHERE {where_clause}').format(table=qualified_name,
                                          delete_table=removing_qualified_name,
                                          where_clause=where_clause)
      return delete_statement
docs: SQL statement for a joined delete from.
      Generate SQL statement for deleting the intersection of rows between
      both tables from table referenced by tablename.