How do i create a custom widget

Is there any complete toturial for newbie? I want to create my own widget. I found a tutorial here:
How to create a widget – Introducing the Piwik Platform - Analytics Platform - Matomo

but dont know how to create a view, viewdatatable, and how to create new table in database, store data into it ??

thanks for help, sorry for my English