Railways Exam  >  Railways Questions  >  Which of the following command is used to add... Start Learning for Free
Which of the following command is used to add attributes to an existing relation?
  • a)
    modify table
  • b)
    drop table
  • c)
    set table
  • d)
    alter table
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Which of the following command is used to add attributes to an existin...
The alter table command to add attributes to an existing relation. All tuples in the relation are assigned null as the value for the new attribute. The form of the alter table command is
alter table r add A D;
where r is the name of an existing relation, A is the name of the attribute to be added, and D is the type of the added attribute.
View all questions of this test
Most Upvoted Answer
Which of the following command is used to add attributes to an existin...
Alter table is the command used to add attributes to an existing relation in a database. This command allows for modifications to be made to the structure of a table, including adding new attributes or columns.

Here is an explanation of each option:

a) Modify table: This is not a valid command in SQL. There is no specific command called "modify table" to add attributes to an existing relation.

b) Drop table: This command is used to delete an entire table from the database. It is not used to add attributes to an existing relation.

c) Set table: This is not a valid command in SQL. There is no specific command called "set table" to add attributes to an existing relation.

d) Alter table: This is the correct command to add attributes to an existing relation. The "alter table" command allows for modifications to be made to the structure of a table. It can be used to add columns, modify column properties, or add constraints to the table.

Example:
Let's say we have a table called "employees" with the following attributes: employee_id, first_name, last_name, and email. If we want to add a new attribute called "phone_number" to this table, we can use the "alter table" command as follows:

```
ALTER TABLE employees
ADD phone_number VARCHAR(20);
```

This command will add a new column called "phone_number" to the "employees" table, with a data type of VARCHAR and a maximum length of 20 characters.

In summary, the correct command to add attributes to an existing relation is the "alter table" command. This command allows for modifications to be made to the structure of a table, including adding new columns.
Explore Courses for Railways exam
Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect answer is option 'D'. Can you explain this answer?
Question Description
Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect 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 Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect 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 Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect 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 Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following command is used to add attributes to an existing relation?a)modify tableb)drop tablec)set tabled)alter tableCorrect 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