SQL Table extension

SQL provides users to create extensions for creating new tables. This technique can be used to create a copy of the existing table and the new table will have all the same schemas as the existing table. The new table will also have the same value as the existing table.
It is used to store the results in temporary tables that save up space in the databases. The new tables have the same schemas and data types as the source table.
- Syntax to CREATE Table Extension –
CREATE TABLE new_table AS
(SELECT column1,column2,...,columnN
FROM table_name
WHERE condition1,condition2,....);
Demo table –
Example – Create a new table as New_products from the existing product table. The New_products should consist of the “Category” & “Region” from the Existing table.
CREATE TABLE New_products AS
(SELECT Category, Region
FROM [dbo].[Products]) ;
- The above syntax will create a New_products having columns as Category, and Region from the Products table. The schema & the data type will also be the same as the existing table.
Other SQL topics to check out:
- What is RDBMS (Relational Database Management System)?
- SQL SELECT Statement
- SQL INSERT INTO SELECT Statement
- SQL ALL Operator
- SQL WHERE Clause
- SQL AND Operator
- SQL OR Operator
Follow us on Twitter, Facebook, Linkedin, and Tableau Public to stay updated with our latest blog and what’s new in Tableau.
If you are looking forward to getting your data pipeline built and setting up the dashboard for business intelligence, book a call now from here.
#analytics #data #business #artificialintelligence #machinelearning #startup #deeplearning #deeplearning #datascience #ai #growth #dataanalytics #india #datascientist #powerbi #dataanalysis #tableau #SQL #businessanalytics #businessanalyst #businessandmanagement #dataanalyst #businessanalysis #analyst #analysis #powerbideveloper #powerbidesktop #letsviz


