List Tables In Database

Create Table

-- Create table called villains
CREATE TABLE villains (
    -- string variable
    name varchar(255)
)

Create Table

-- Create table called heroes
CREATE TABLE heroes (
    -- string variable
    name varchar(255)
)

Create Table

-- Create table called battles
CREATE TABLE battles (
    -- string variable
    name varchar(255)
)

List Tables In Database

SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE'
table_name
battles
heroes
villians