I have created a database, in mariadb, I need to save in my .sql file my database and the code lines I use to create it, for example if I did:
CREATE TABLE ejemplo ( id VARCHAR(20), x INT, PRIMARY KEY ( id,x ) FOREIGN KEY x REFERENCES otratabla(x) );
What I have to do is besides exporting my database, also the code lines of how I created it, with the create table, pks, fks, etc, it is not enough to create the base and after that the one that wants see do a show create table, my goal is that, create the table, put step by step as I did, that's what I mean by exporting the code lines.
The objective is to show my way of programming, looking only for ways to export the base itself, and not also the lines I used to make it, or different queries that I needed to make to it.
I understand that this is how it is exported:
mysqldump -u root -p LIBRARY > library-exit.sql
And responding to:
When you export the database, what it does is: It generates a file with SQL extension and if you open that file with a text editor and ... pum! You find all the code of your bd, ... tables and what has your tables, columns, data type etc., ... and if you have entered data it also generates them in that same file. So, what do you really need?
Well, if it shows how I believe it line by line, ..., that answers part of my query, I would also like to know if there is any way to also save in my sql file, the queries I want to make to the base, and the results (tables) it would return.