Share
SQL Query | Level – Basic 4
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
How can you create an empty table from an existing
table?
Suppose the name of existing table is student and new table is studentcopy
Answers ( 2 )
Assumption:
A is an already existing table.
Create table B
as select * from A
where 1=2
To create an empty table from existing table , we just have to give any false condition in the SELECT query , so that it will fail to fetch the records and create copy of the table only , not copy the data
CREATE TABLE studentcopy
AS SELECT * FROM student
WHERE 2 > 3