Search code snippets, questions, articles...

Rename table MySQL

RENAME TABLE statement is used to change that the name of a single table or multiple tables.
-- SINGLE TABLE
RENAME TABLE courses TO subjects;

-- MULTIPLE TABLES
RENAME TABLE 
    courses TO subjects,
    topics TO subject_topics;

In the code snippet, we are renaming or changing the name of a table from 'courses' to 'subjects'. We can also change multiple table names with a single query.

Search Index Data (The code snippet can also be found with below search text)

Change table name MySQL
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet