Yes that is technically possible, however I think it's a very bad idea.
There is an API that you can use to create elements and relations, which will guarantee the correct records to be created.
If you do it directly on the database, you'll have to take into account all the exceptions and oddities.
There's a pretty good chance of breaking things.
I only use direct database updates or inserts when there is no feasible alternative.
That can either be because the API doesn't support updating or creating a certain thing, or because I need to do so many that it would take days when using the API.
Geert