How to Create Table From Existing Table in MYSQL || MySQL Tutorial

Опубликовано: 25 Март 2026
на канале: Code With Neha
1,093
22

In one of my previous video of mysql series I have shared how to create table in mysql Using create table today I am going to show how to create table using existing table with or without data so without any further delay let's get started


Today I am going to create another table from student table under school details database

Let us name the 2nd table as student table 1

copying the query Select * from student_table
And just before this query writing create table student_table 1 which is the 2nd table name followed by as query
Let's run this query
And see the result
And you can see 2nd table student table 1 is created from student table

dropping the 2nd table each time to execute remaining query

Now if we want to just copy the table without data

In that case using a false condition 1=0 just after select * from student table

The query is create table student table 1 as select * from student table where 1=0;

This false condition is used so that no data will be inserted in the 2nd table

Let's run it

Here table is copied without data

Now if we want to copy just 2 to 3 columns from existing table in that case

Just specify the columns we want beside select statement

See only specific columns are copied

Now to copy specific columns without data just add false condition


That's it for today
Hope you all will get some help from this video If it's so then don't forget to subscribe my channel Code with Neha and press the Bell Icon to never miss an update
See you in the next video till then Stay Safe Stay Happy


#mysql
#mysqltutorial
#Howtocreatetablefromexistingtableinmysql
#Howtocreatetablefromexistingtableinsql
#createtablefromexistingtableinmysql
#createtableinsql
#sqlcopytable
#copytableinsql
#howtocreateatableinsql
#howtoclonetablewithdata
#Howdoyoucloneatablewithdata
#copytabletoanothertablesql
#copytablefromsqldatabase
#Howtocopydatafromoneexistingtabletoanotherexistingtable
#SQLCloningorCopyingatable
#createtablelikeanothertable
#TemporarytableMySQLexample
#MySQLCREATETABLEonexistingtable
#MySQLcreatetablefromanother
#MySQLcreatetablefromexisting
#MySQLCopyExistingTable
#MySQLCopyTable
#Copytableinmysql
#Cloningtablewithexistingdata
#sqlcopytablefromonedatabasetoanotherinsertingdataintables
#clonetabledata
#MSSQLCloningtablewithexistingdata
#CreateCloneofExistingTableinSQLServer
#copydataandstructurefromexistingtabletonewtableinsql
#sqlquerytocopytable
#sqlquerycopytable
#estoretableinsql
#sqltutorialforbeginners
#sqlserver
#copytable
#sqltablecopy
#copydatabasetable
#sqlservercopytable
#sqldeveloper
#learnsql
#sqltutorial
#howtoinsertdataintotableinmysql
#insertdataintotableusingmysq
#insertdataintotableinmysql
#insertdataintotable
#mysqladddataintotable
#mysqlinsertdataintotable
#mysqlinsertquery
#mysqladdquery
#mysqlinsertquerywithexample
#mysqlinsert
#sqlinsertcommand
#mysqlinsertintocommand
#howtoinsertdataintableswithsql
#sqlbasics
#mysqlcourse
#mysqltutorialinhindi
#mysqldatabasetutorial
#mysqlcrashcourse