Like this ?

    LoadPlugin notify_dbi
    <Plugin notify_dbi>
      <Query "alert_history">
        Severity "Failure"
        Severity "Warning"
        Severity "Ok"
        Statement "INSERT INTO alert_history (host, plugin, plugin_instance, type, type_instance, time, severity, message) VALUES ('%{host}', '%{plugin}', '%{plugin_instance}', '%{type}', '%{type_instance}', '%{time}', '%{severity}', '%{message}')"
      </Query>
      <Query "alert_delete">
        Severity "Failure"
        Severity "Warning"
        Severity "Ok"
        Statement "DELETE FROM alert where host = '%{host}' and plugin = '%{plugin}' and plugin_instance = '%{plugin_instance}' and type = '%{type}' and type_instance = '%{type_instance}'"
      </Query>
      <Query "alert_insert">
        Severity "Failure"
        Severity "Warning"
        Statement "INSERT INTO alert (host, plugin, plugin_instance, type, type_instance, time, severity, message) VALUES ('%{host}', '%{plugin}', '%{plugin_instance}', '%{type}', '%{type_instance}', '%{time}', '%{severity}', '%{message}')"
      </Query>
      <Database "mysql">
        Driver "mysql"
        DriverOption "host" "127.0.0.1"
        DriverOption "port" "3306"
        DriverOption "username" "collectd"
        DriverOption "password" "collectd"
        DriverOption "dbname" "collectd"

        Query "alert_history"
        Query "alert_delete"
        Query "alert_insert"
      </Database>
    </Plugin>