We present a technique for integrating expert systems and database management systems (DBMSs). Such integration is essential to accommodate new expert system applications that require a large volume of factual information that cannot be stored in main memory. We propose the Extended Disjunctive Normal Form (EDNF) as the basis of our approach and discuss how we can achieve performance in the integrated system using this technique. The EDNF is an extension of the disjunctive normal form of relational algebra expressions so as to include recursion. The EDNF is well suited for loose coupling, where an existing DBMS and optimization can be fully exploited. We first present the basic form of the EDNF and then use it as a building block to process a more general class of queries. We extend valid usage of Clark's negation-as-failure evaluation technique to incorporate negation for most practical situations. We also propose new criteria for safety and termination in the presence of negation. To the extent of the authors' knowledge, optimization in the loose coupling of expert systems and DBMSs has not been seriously addressed in previous research. We believe our technique provides significant progress in this direction.