select count(bookmark_id) as n_existing
from bm_bookmarks
where bookmark_id = :bookmark_id
select count(*) from bm_bookmarks
where owner_id = :viewed_user_id
and parent_id = :parent_id
and folder_p = 't'
and local_title = :local_title
select bookmark_id
from bm_bookmarks
where folder_p = 't'
and owner_id = :user_id
and local_title = :local_title
select url_id
from bm_urls
where complete_url = :complete_url
select count(bookmark_id)
from bm_bookmarks
where url_id = :url_id
and owner_id = :viewed_user_id
and parent_id = :parent_id
select count(bookmark_id)
from bm_bookmarks
where bookmark_id = :bookmark_id