The output indicates that all the tables are the base tables except for the contacts view. + -+-+ĩ rows in set ( 0.00 sec) Code language: SQL (Structured Query Language) ( sql ) Now, you run the SHOW FULL TABLES command: SHOW FULL TABLES Let’s create a view called contacts in the classicmodels database: CREATE VIEW contacts AS SELECTĬode language: SQL (Structured Query Language) ( sql ) Output: +-+-+Ĩ rows in set (0.00 sec) Code language: JavaScript ( javascript ) SHOW FULL TABLES Code language: SQL (Structured Query Language) ( sql ) To include the table type in the result, you use the following form of the SHOW TABLES statement. The SHOW TABLES command allows you to show if a table is a base table or a view. Show tables in the classicmodels database: show tables Ĩ rows in set ( 0.00 sec) Code language: SQL (Structured Query Language) ( sql ) SHOW FULL TABLES statement Switch to classicmodels database: use classicmodels Code language: SQL (Structured Query Language) ( sql ) Connect to the MySQL database server: mysql -u root -p Code language: SQL (Structured Query Language) ( sql )Įnter the root’s password and press enter to connect to the MySQL server. The following example shows you how to list all the tables in the classicmodels database. SHOW TABLES Code language: SQL (Structured Query Language) ( sql ) MySQL SHOW TABLES examples Second, switch to a specific database using the USE statement.First, log in to the MySQL database server using a MySQL client such as mysql.To list tables in a MySQL database, you follow these steps:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |