
select MMS_ENTRY.id, count(*) as atoms,
	sqrt(power(max(cartn_x)-min(cartn_x),2) +
	power(max(cartn_y)-min(cartn_y),2) +
	power(max(cartn_z)-min(cartn_z),2)) as Diagonal_3D
    from MMS_ENTRY, ATOM_SITE
    where MMS_ENTRY.entry_key=ATOM_SITE.entry_key
    group by MMS_ENTRY.id ;
