Yogesh_Verma_
Contributor II

Hey @OODDATAEng 

To create a new table in Databricks using the schema and data from an existing table, you can use the CREATE TABLE AS SELECT command. This command allows you to define a new table based on the results of a SELECT query executed on the existing table. 

Here's a breakdown of the command and its components:

Code

 

CREATE TABLE new_table_name

AS

SELECT * FROM existing_table_name;

CREATE TABLE new_table_name:

Yogesh Verma