Insert
$themeId=3;
$this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\App\ResourceConnection');
$connection= $this->_resources->getConnection();
$themeTable = $this->_resources->getTableName('theme');
$sql = "Insert into " . $themeTable . "(theme_id,theme_path) Values (" . $themeId . ",'webmull/christmastheme' )";
$connection->query($sql);
Update
$themeId=3;
$this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\App\ResourceConnection');
$connection= $this->_resources->getConnection();
$themeTable = $this->_resources->getTableName('theme');
$sql = "Update " . $themeTable . " set theme_path='webmull/christmastheme' WHERE theme_id = " . $themeId . ";";
$connection->query($sql);
Delete
$themeId=3;
$this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\App\ResourceConnection');
$connection= $this->_resources->getConnection();
$themeTable = $this->_resources->getTableName('theme');
$sql = "DELETE FROM " . $themeTable . " WHERE theme_id = " . $themeId . ";";
$connection->query($sql);
Select
$themeId=3;
$this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\App\ResourceConnection');
$connection= $this->_resources->getConnection();
$themeTable = $this->_resources->getTableName('theme');
$sql = "Select * FROM " . $themeTable . " WHERE theme_id = " . $themeId . ";";
$connection->fetchAll($sql);