This submit will talk about the best technique to question an inventory in MySQL.
The way to Question a Checklist in MySQL?
Observe the below-provided directions to question an inventory in MySQL:
- Open the Home windows terminal.
- Join with a specific MySQL database by offering its username and password.
- Show all present databases and select the specified one.
- Change the database and use the “SELECT <column-name> FROM <table-name>” command to checklist specific desk column information.
Step 1: Launch “Command Immediate”
Initially, open the Home windows terminal by using the Startup menu:
Step 2: Join MySQL Database
Then, execute the offered command to log in along with your MySQL server to begin the companies regionally and join with the terminal:
Right here:
- “-u” possibility represents the person.
- “root” is the default username specified whereas putting in MySQL.
- “-p” possibility denotes the password.
When above acknowledged command is executed, you may be requested to supply the person password:
Step 3: View All Databases
Subsequent, to show the checklist of all at present present databases, execute the “SHOW” command with the “DATABASES” possibility:
As you’ll be able to see, all databases are listed, and now we have chosen the “mariadb” database for additional course of:
Step 4: Change Database
Now, run the “USE <database-name>” command and navigate to the specified database:
Step 5: Question Checklist in MySQL
Lastly, execute the “SELECT Shade FROM mariadb” question to view the checklist of information in MySQL:
SELECT Shade FROM mariadb;
Within the above-stated question:
- “SELECT” assertion is used to pick the information from the accessible databases.
- “Shade” is the column title that comprises information.
- “FROM” clause is utilized for choosing desired information from present tables of the database.
- “mariadb” is the title of our desk that’s created inside our database:
It may be noticed that when the above-provided question is executed, the information contained in the “Shade” column is listed under:
That’s it! We’ve compiled the best technique to question an inventory in MySQL.
Conclusion
To question an inventory in MySQL, first, open the Home windows terminal and join along with your MySQL database by offering a username and password. Then, checklist all present databases and select the specified one. Subsequent, transfer to it and execute the “SELECT <column-name> FROM <table-name>” question to checklist specific desk column information. This submit demonstrated the tactic to question an inventory in MySQL.