Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MySQL Programming Interview Question:
How To Rename an Existing Table in MySQL?
Submitted by: AdministratorIf you want to rename an existing table, you can use the "ALTER TABLE ... RENAME TO" statement. The tutorial script below shows you a good example:
mysql> ALTER TABLE tip RENAME TO faq;
Query OK, 0 rows affected (0.01 sec)
<pre>mysql> SELECT * FROM faq;
+----+-------------+-------------------------+--------+
| id | title | description | author |
+----+-------------+-------------------------+--------+
| 1 | Learn MySQL | Visit www.GlobalGuideLine.com | NULL |
+----+-------------+-------------------------+--------+</pre>
1 row in set (0.00 sec)
Submitted by: Administrator
mysql> ALTER TABLE tip RENAME TO faq;
Query OK, 0 rows affected (0.01 sec)
<pre>mysql> SELECT * FROM faq;
+----+-------------+-------------------------+--------+
| id | title | description | author |
+----+-------------+-------------------------+--------+
| 1 | Learn MySQL | Visit www.GlobalGuideLine.com | NULL |
+----+-------------+-------------------------+--------+</pre>
1 row in set (0.00 sec)
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.