select case when count(*) = 0 then 0 else 1 end from apm_package_types
where pretty_plural = :pretty_plural
select case when count(*) = 0 then 0 else 1 end from apm_package_types
where pretty_name = :pretty_name
select case when count(*) = 0 then 0 else 1 end from apm_package_types
where package_uri = :package_uri
select case when count(*) = 0 then 0 else 1 end from apm_package_versions
where version_uri = :version_uri
select case when count(*) = 0 then 0 else 1 end from apm_package_versions
where version_id = :version_id