javascript mysql list tables in database code example

Example 1: sql query to list all tables in a database sql server

BY LOVE SINGH on May 19 2020

SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='YOUR_Database_name'

Example 2: how to create a table in mysql

-- 'CREATE TABLE' followed by the name of the table. 
-- In round brackets, define the columns.
CREATE TABLE `test_table` 
(
  id INT(10) PRIMARY KEY,			
  username VARCHAR(50) NOT NULL
);

Example 3: mysql is in list

SELECT 
    column1,column2,...
FROM
    table_name
WHERE 
	(expr|column_1) IN ('value1','value2',...);

Tags:

Sql Example