What will be the result of executing the following SQL statement?
CREATE TABLE Employees (ID INT PRIMARY KEY, Name VARCHAR(50), Age INT);
Choose the correct description of what this statement does.
Think about what the CREATE TABLE command does in SQL.
The CREATE TABLE statement creates a new table with the specified columns and constraints. It does not delete or rename tables.
What happens when you execute the following SQL command?
ALTER TABLE Employees ADD COLUMN Salary DECIMAL(10,2);
Consider what ALTER TABLE with ADD COLUMN does.
ALTER TABLE with ADD COLUMN adds a new column to an existing table without affecting existing data.
What is the immediate effect of running this SQL command?
DROP TABLE Employees;
Choose the correct outcome.
Think about what DROP TABLE does compared to DELETE or TRUNCATE.
DROP TABLE removes the entire table and its data permanently from the database.
Which statement correctly describes the difference between these two commands?
ALTER TABLE Employees MODIFY Age SMALLINT;
ALTER TABLE Employees RENAME TO Staff;
Consider what MODIFY and RENAME TO do in ALTER TABLE statements.
MODIFY changes a column's data type or definition; RENAME TO changes the table's name.
What error will this SQL command produce if the column 'Salary' does not exist in the Employees table?
ALTER TABLE Employees DROP COLUMN Salary;
Think about what happens when you try to drop a column that isn't there.
Most SQL databases raise an error if you try to drop a column that does not exist.