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.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
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