In SQL Server, how to write a query in case ItemType = MD5 then replace Null value as 'NAM' ?
 Country ItemType
  Null    MD5
Use CASE EXPRESSION :
SELECT CASE WHEN t.ItemType = 'MD5' THEN 'NAM' ELSE t.country END as [Country],
       t.itemType
FROM YourTable t
If you want it only to be replace when Country is NULL, then replace it with this:
CASE WHEN t.ItemType = 'MD5' AND t.country IS NULL THEN 'NAM' ELSE t.country END