When we start our queries first of all we have to know that , a database contain tables and a tables contain data . Thus if we need to use data we first need to enter in database and then in table.
We can enter in any database by using USE <DATABASE NAME>;
It can be used as , Suppose a database named Menagerie
Now this command used as USE Menagerie;
+---------------------------------------------------------------------------------------------------------+
NOTE :- There is a space gap between USE and Menagerie in previous Command.
We use this semi-colon sign ";" to close any statement.
+---------------------------------------------------------------------------------------------------------+
Now if we want to see the list of our databases then we use SHOW DATABASES;
It will display all the names of databases.
Now if we want to see the list of our tables in database then we use SHOW TABLES;
TO EXIT FROM MY SQL YOU CAN TYPE EXIT;
We can enter in any database by using USE <DATABASE NAME>;
It can be used as , Suppose a database named Menagerie
Now this command used as USE Menagerie;
+---------------------------------------------------------------------------------------------------------+
NOTE :- There is a space gap between USE and Menagerie in previous Command.
We use this semi-colon sign ";" to close any statement.
+---------------------------------------------------------------------------------------------------------+
Now if we want to see the list of our databases then we use SHOW DATABASES;
It will display all the names of databases.
Now if we want to see the list of our tables in database then we use SHOW TABLES;
TO EXIT FROM MY SQL YOU CAN TYPE EXIT;
No comments:
Post a Comment