The only way to find out whether Oracle (for example) is installed or not ...
... is to start out with SOME idea of what you're LOOKING FOR!
I recall from my Solaris days that Oracle *did* use the Solaris package manager, and you *could* find out whether it was installed or not with a command like this (I don't recall the *exact* syntax):
pkginfo | grep -i ora
So you get to do the following:
1. Find a system with Oracle installed.
Or do a trial install yourself.
Or get a logon to Oracle's OTN and read the on-line documentation.
2. Determine how it *should* be installed, and write a script to check for it.
3. Determine if your organization (school or company) has a *policy* that
states the database *will* be installed like your script *expects* it to be.
4. Repeat steps 1..3 for each platform your organization supports (Linux, Solaris, etc)
5. Repeat steps 1..4 for each database your organization supports (Oracle, DB2, MS-SQL, etc)
These are steps that YOU need to do. There is, unfortunately, no "one-size-fits-all" answer that you can read out of a book ... or get told about on a forum like this.