Regarding SQL Server at least (I can't speak to Oracle), they've created something of a network effect.
SQL Server is really expensive. But, the more Microsoft stack you have in house the more discounts you get. The more Microsoft certified staff you have, the more discounts you get. This biases companies to hiring more developers with Microsoft certs, which leads to more developers getting Microsoft certs, which leads to more discounts and a feeling of investment at higher levels of the company that lead them to be unwilling to switch.
I spent 5 years at a company that was using SQL Server as the backbone of it's flagship product. They pushed it as far as they could, but ultimately the biggest issues with the product at the company revolved around either limitations of SQL Server, lack of features with SQL Server or licensing being prohibitive of different types of beneficial scaling strategies. I pushed for them to make the switch to PostgreSQL for probably my last 3 years there as part of the architecture group, including migration and training plans, etc but it was like talking to a wall. Nobody could acknowledge the SQL Server issues. Everyone who had a part in considering solutions was too invested as far as I could tell. Eventually they tried moving to Couchbase (NoSQL) before finally making the switch to PostgreSQL from what I heard from people I know who still work there.
As far as query interfaces go, you can use just about any tool you like. I prefer Navicat myself but I know a lot of people like DBeaver and DataGrip.