Railways Exam  >  Railways Questions  >   To delete a particular column in a relation ... Start Learning for Free
To delete a particular column in a relation the command used is:
  • a)
    DELETE
  • b)
    UPDATE
  • c)
    DROP
  • d)
    ALTER
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
To delete a particular column in a relation the command used is:a)DEL...
To remove a column, ALTER command can be used in the following manner
ALTER TABLE < table="" name="" /> DROP COLUMN < column="" name="" />
Whatever data was in the column disappears. The table constraints involving the column are also dropped.
View all questions of this test
Most Upvoted Answer
To delete a particular column in a relation the command used is:a)DEL...
Deleting a Column in a Relation using ALTER Command

In SQL, ALTER command is used to modify the existing structure of a table or a relation. One of the modifications that can be made using ALTER command is deleting a particular column from a relation. The syntax for deleting a column using ALTER command is as follows:

ALTER TABLE table_name
DROP COLUMN column_name;

Here, the keyword ALTER is used to modify the table structure, followed by the name of the table from which the column is to be deleted. Then, the keyword DROP COLUMN is used to specify that a particular column is to be deleted. Finally, the name of the column to be deleted is mentioned.

For example, consider a relation named STUDENT with the following schema:

STUDENT (RollNo, Name, Age, Gender, Address)

To delete the column Address from the STUDENT relation, the following ALTER command can be used:

ALTER TABLE STUDENT
DROP COLUMN Address;

This will remove the Address column from the STUDENT relation, and the new schema of the relation will be:

STUDENT (RollNo, Name, Age, Gender)

It is important to note that when a column is deleted from a relation, all the data stored in that column is also deleted permanently. Therefore, it is recommended to take a backup of the data before performing any structural modifications on a table.

Conclusion

To delete a particular column from a relation, the ALTER command with the DROP COLUMN subcommand is used. The syntax of the command specifies the name of the table and the column to be deleted. This command permanently deletes the column and all the data stored in it.
Explore Courses for Railways exam
To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer?
Question Description
To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer? for Railways 2024 is part of Railways preparation. The Question and answers have been prepared according to the Railways exam syllabus. Information about To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for Railways 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer?.
Solutions for To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Railways. Download more important topics, notes, lectures and mock test series for Railways Exam by signing up for free.
Here you can find the meaning of To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice To delete a particular column in a relation the command used is:a)DELETEb)UPDATEc)DROPd)ALTERCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice Railways tests.
Explore Courses for Railways exam

Top Courses for Railways

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev