We use technical tasks for our technical debt type stuff. Things we do as an Agile development team that are not (necessarily) customer facing, but need to be done. Maybe re-indexing a database so it processes faster. Rewriting a load script so it is more efficient.
In the example above, I would not use a technical task. Creating the database for the story, is part of the story, as is creating a button. Getting that granular in the stories with tasks is a lot of inventory and overhead.
MH Bakoa, what do you mean by a technical task? I see two options:
Item in the Product Backlog
Item in the Sprint Backlog created after splitting User Stories into smaller portions
As Melissa said, your examples sound more like option 2. There's a user story and to implement it some tasks need to be done. If that's the case then it's up to Development team how many tasks they create, what will be the titles and content. Tasks are just a way to realize the plan for the Sprint. The team decides how precise the plan should be.