DBI is an API used to connect to a data source, and pass it commands. SQL is a language used to interact with a certain class of database sources. So you use DBI to send SQL to the server, if your server speaks SQL and there is a DBI driver available for it.