How do I create table in custom module In Drupal 7 we used to use hook_schema() in the .install file to create a table. I believe that, in Drupal 8, you can do that as well, but I was under the impression that you should create .yml files with your schema.

What's the method for creating tables in Drupal 8?
You can use hook install to create your own tables, if you really want to, although Drupal has many other more out-of-the-box solutions.  But if you do want to roll your own, there's an example module, called dbtng_example, in the examples module: https://www.drupal.org/project/examples, complete with routing for adding and removing your custom database entries.

I'd recommend installing it and trying it out, then you can use that as a basis for creating your own database table in Drupal 8.

Another approach to consider is to create a config entity or a content entity.

If you use the drupal command line tool there's even a command for generating these "drupal generate:entity:config", and "drupal generate:entity:content".

Also in the examples module, there is config_entity_example and content_entity_example.

From https://www.previousnext.com.au/blog/understanding-drupal-8s-config-entities: "The main difference between content and config entities is how they are stored and (at the moment) config entities are not fieldable".

There are some other more out of the box solutions, such as the config_pages module that allow you to easily spin up places to store data on your site:
https://www.drupal.org/project/config_pages

We recently used these for one off landing pages, by creating a controller and route.  This has a huge advantage over a custom table as you can easily add new fields and you can use data types such as images and entity references easily, you can also set field formatters, and load the data formatted using the config_pages entity view builder.