Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In MySQL Workbench, is there a page showing the number of records in each table in a database?

In phpMyAdmin, on the Structure page for each database, there is a table showing all the tables in the DB and the number of records in each table. Is there something similar in Workbech?

Thanks.

like image 729
Geoffrey Avatar asked Dec 16 '10 17:12

Geoffrey


People also ask

How do I find the number of records in a table in MySQL?

Counting all of the Rows in a Table. To counts all of the rows in a table, whether they contain NULL values or not, use COUNT(*). That form of the COUNT() function basically returns the number of rows in a result set returned by a SELECT statement.

How can we get the number of records or rows in a table?

The SQL COUNT() function returns the number of rows in a table satisfying the criteria specified in the WHERE clause. It sets the number of rows or non NULL column values. COUNT() returns 0 if there were no matching rows. The above syntax is the general SQL 2003 ANSI standard syntax.

How do you display all records of the table in a database?

The first command you will need to use is the SELECT FROM MySQL statement that has the following syntax: SELECT * FROM table_name; This is a basic MySQL query which will tell the script to select all the records from the table_name table.

How do I see rows in MySQL workbench?

Inside the workbench right click the table in question and click "Select Rows - Limit 1000." It's the first option in the pop-up menu. Show activity on this post. To get the convenient list of tables on the left panel below each database you have to click the tiny icon on the top right of the left panel.


2 Answers

Late answer but for anyone else who comes across this page the way to do this in MySQL Workbench 6.0 is:

  1. Right click the table in the Navigator pane
  2. Select "Table Maintenance..."
  3. Navigate to the "Indexes" tab
  4. Scroll to the right to find the "Cardinality" column.

This column shows you the number of values for each of the primary and navigation keys in the each table in your database. The number of values for your PRIMARY key is the number of rows. Hope that helps.

Another way is to:

  1. Right-click the database in the Navigator pane.
  2. Select "Schema Inspector".
  3. Navigate to the "Tables" tab, which will have a "Rows" column for each table in the database.
like image 63
JHowIX Avatar answered Sep 21 '22 13:09

JHowIX


I dont know how to do it in MySQL Workbench but the following query returns the number of rows in a table.

SELECT COUNT(*) FROM table_name;
like image 20
nilsi Avatar answered Sep 17 '22 13:09

nilsi