• +91 9723535972
  • info@interviewmaterial.com

DBMS Interview Questions and Answers

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:

CREATE TABLE DuplicateCustomer AS SELECT * FROM Customers;
Similarly, if you want to create a duplicate table without the data present, mention the following query:

CREATE TABLE DuplicateCustomer AS SELECT * FROM Customers WHERE 1=2;

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners