How many master customer ID numbers are there?
select count ( master_customer_id ) from customer_master_index
What are the master index IDs for all except whose detail includes Schmidt, Kertzmann and Lubowitz?
select master_customer_id from customer_master_index where cmi_details ! = ( 'Schmidt, kertzmann and Lubowitz' )
What are their cmi cross reference IDs?
select t1.master_customer_id,cmi_cross_ref_id from customer_master_index as t1 join cmi_cross_references as t2 on t1.master_customer_id = t2.master_customer_id where t1.cmi_details not in ( 'Schmidt, kertzmann and Lubowitz' )
What are their respective source system codes?
select t1.master_customer_id,cmi_cross_ref_id,source_system_code from customer_master_index as t1 join cmi_cross_references as t2 on t1.master_customer_id = t2.master_customer_id where t1.cmi_details ! = ( 'Schmidt, kertzmann and Lubowitz' )
What are the renters arrears tax IDs associated with them?
select t1.council_tax_id from rent_arrears as t1 join cmi_cross_references as t2 on t1.cmi_cross_ref_id = t2.cmi_cross_ref_id join customer_master_index as t3 on t3.master_customer_id = t2.master_customer_id where t3.cmi_details ! = 'Schmidt, kertzmann and Lubowitz'