The document outlines a series of SQL commands for manipulating a database, including creating a replica of the Employee table, dropping a column, adding new columns, modifying data types, and renaming tables. It also includes instructions for adding attributes to existing tables and changing column names while maintaining data types. The commands demonstrate basic SQL Data Definition Language (DDL) operations for managing database schema.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
1 views6 pages
DBMS Lab7
The document outlines a series of SQL commands for manipulating a database, including creating a replica of the Employee table, dropping a column, adding new columns, modifying data types, and renaming tables. It also includes instructions for adding attributes to existing tables and changing column names while maintaining data types. The commands demonstrate basic SQL Data Definition Language (DDL) operations for managing database schema.
7. Write a SQL statement to rename the table department to
dept (with both methods). rename table department to dept; alter table department rename dept; show tables; 8. Write a SQL statement to add a column regionId to the table locations. alter table location add (regionID int);
desc location;
9. Write a SQL statement to change the name of the column
state_province to state in locations table, keeping the data type and size same. alter table locations change column state_province state varchar(20);