To update the categories display mode using sql query in magento2 database
use below update query to update display mode
UPDATE catalog_category_entity_varchar SET value='PAGE' WHERE attribute_id=49 AND store_id=0 AND entity_id in(<categoryids>);
UPDATE catalog_category_entity_varchar SET value='PAGE' WHERE attribute_id=49 AND store_id=0 AND entity_id in(<categoryids>);