Using relational database tables in SQL

SQL: Functions can be combined with other queries. For example:

Find substructures with similar glogP values

Select smiles from nci.structure where
abs(structure.glogp - glogp('c1ccccc1C(=O)NC')) < 0.5
        and matches(smiles, 'c1ccccc1C(=O)NC')

Identify structures which violate Rule of 5 guidelines

Select smiles from nci.structure where not amw(smiles) > 500.0 and not glogp(smiles) > 5.0
and not count_matches(smiles,'[#7,#8]') > 10 and not count_matches(smiles,'[!H0;#7,#8]') > 5

More...