DBMS Lab Activity
DBMS Lab Activity
Create Table
CODE :
StudentID INT,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Age INT
);
The ALTER TABLE command is used to add, delete, or modify columns in an existing table.
CODE :
CODE :
Drop a column named EnrollmentDate from the Students table (Note: The column name needs to be
correct, EnrollmentDate instead of EnrollamentDate):
CODE :
The DROP TABLE command deletes an entire table and all of its data.
CODE :
OUTPUT :
Q.2 Run the following SQL Command
EmployeeID INT.
EmployeeName VARCHAR(100),
Bio TEXT
);
The SQL command you've provided has some syntax errors. Here's the corrected SQL command to create
the Employees table:
CODE:
EmployeeID INT,
EmployeeName VARCHAR(100),
DateOfJoining DATE,
Bio TEXT
);
Corrections Made:
Corrected Date Offeining to DateOfJoining (assuming this was the intended column name).
This command creates a table named Employees with columns for the employee ID, name, date of
joining, salary, and a text bio.
CODE :
OUTPUT :