Question - Write a query to create a duplicate table with and without data present?
Answer -
Consider you have a table named Customers, having details such as CustomerID, CustomerName and so on. Now, if you want to create a duplicate table named ‘DuplicateCustomer’ with the data present in it, you can mention the following query:
1 CREATE TABLE DuplicateCustomer AS SELECT * FROM Customers;
Similarly, if you want to create a duplicate table without the data present, mention the following query:
1 CREATE TABLE DuplicateCustomer AS SELECT * FROM Customers WHERE 1=2;