how to get create table query in postgresql?
CREATE TABLE new_table_name AS query; In this syntax: First, specify the new table name after the CREATE TABLE clause. Second, provide a query whose result set is added to the new table after the AS keyword.