qfedu-linux-advanced-level/day9/homework/h4.sql

16 lines
405 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
修改login表的passwd的字段名为auth_string修改person表名为profile_info
*/
-- 修改login表的passwd字段名为auth_string
ALTER TABLE login
CHANGE passwd auth_string VARCHAR(50);
-- 将person表重命名为profile_info
RENAME TABLE person TO profile_info;
-- 显示login表结构查看字段修改结果
DESCRIBE login;
-- 显示bookdb库结构查看表重命名结果
SHOW TABLES;