SQL Alter – SQL TUTORIAL | Software Testing Material

SQL ALTER Query:

SQL ALTER TABLE statement is used to add, delete, or modify columns in an existing table.

T0 Add A Column In A Table – Syntax:

Example:

SQL Alert

In the above image, you could find total number of columns are 5 (such as Playername, Runs, Balls, Sixers, and fours) related to first SELECT query where as the total number of columns are 6 (such as Playername, Runs, Balls, Sixers, fours, and DotBalls) related to second SELECT query. We have executed ALTER statement to add a new column (DotBalls) in the table ‘SCOREBOARD’.

To Delete A Column In A Table – Syntax:

Note: Some database systems don’t allow deleting a column.

Example:

SQL Alert Drop

 

To Change The Data Type Of A Column In A Table – Syntax:

In the next tutorial, we will see How To Use DROP Query in SQL

Check out the complete SQL Tutorial by clicking on below link:

Sharing is caring.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

Leave a Comment

Your email address will not be published. Required fields are marked *

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook

DOWNLOAD FOR FREE