To add to Davo's comment, the XMLDB editor not only allows you to create a table, but it spits out the PHP that you can copy and paste into an upgrade.php file. I missed that feature when I first started working on it.
General developer forum
Creating a table through block/db/upgrade. Moodle 3.4+
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.