mysql show schema 1

mysql show schema

describe [db_name.]table_name;

Here is what the above code is Doing:
1. We’re creating a new table called “users” with the following columns:
– id: an integer that will be the primary key for the table.
– name: a string that will be the name of the user.
– email: a string that will be the email of the user.
– password: a string that will be the password of the user.
2. We’re creating a new table called “posts” with the following columns:
– id: an integer that will be the primary key for the table.
– title: a string that will be the title of the post.
– content: a string that will be the content of the post.
– user_id: an integer that will be the id of the user who created the post.
3. We’re creating a new table called “comments” with the following columns:
– id: an integer that will be the primary key for the table.
– text: a string that will be the text of the comment.
– user_id: an integer that will be the id of the user who created the comment.
– post_id: an integer that will be the id of the post that the comment is on.

Similar Posts