Question: where is wpdb defined in wordpress?
Answer: For performing database operations WordPress provides a class wpdb which is present in the file – wp-includes\wp-db. php. This class abstracts the database functions for WordPress and most WordPress functions directly or indirectly use this class. This class is based on the ezSQL class.