exam questions

Exam 98-364 All Questions

View all questions & answers for the 98-364 exam

Exam 98-364 topic 1 question 99 discussion

Actual exam question from Microsoft's 98-364
Question #: 99
Topic #: 1
[All 98-364 Questions]

You need to rename a column in a database table.
Which data definition language (DDL) statement should you use?

  • A. ALTER
  • B. INSERT
  • C. CREATE
  • D. UPDATE
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
nxp1968
Highly Voted 4 years, 11 months ago
A is correct! ALTER TABLE "table_name" Change "column 1" "column 2" ["Data Type"];
upvoted 10 times
...
dzoni68
Most Recent 3 years ago
The correct answer is A. The ALTER command is a DDL command to modify the structure of existing tables in the database by adding, modifying, renaming, or dropping columns and constraints. Use the ALTER TABLE RENAME command to rename column names. Example: ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name;
upvoted 1 times
...
Morgane
3 years, 8 months ago
A.ALTER. That said, this is really for the sake of learning about DDL/DML etc, and it would be better if they could update that question to ask about removing a column rather than renaming a column. Reason is that those working using SQL Server Management Studio will use the EXEC sp_rename to rename a column as opposed to (I presume) MySQL, Oracle etc. I tried many combinations to rename a column in my Azure Data Studio using ALTER statements (tried ALTER COLUMN, MODIFY, RENAME, CHANGE etc) and nothing worked. Then I executed this sp_rename and it worked no problem - though we also need to be careful about renaming columns as it can affect stored procedures and other things apparently. Anyways, if anyone wants to try, they can find the full EXEC sp_rename statement here: https://docs.microsoft.com/en-us/sql/relational-databases/tables/rename-columns-database-engine?view=sql-server-ver15
upvoted 1 times
...
moehijawe
5 years, 6 months ago
None of the above, changing column should be done by using a procedure EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN'; reference : https://docs.microsoft.com/en-us/sql/relational-databases/tables/rename-columns-database-engine?view=sql-server-ver15
upvoted 4 times
akkkkkkk
5 years, 1 month ago
well i mean this course was published in 07
upvoted 1 times
Jovial
5 years ago
how would you rename table by using alter table ?
upvoted 1 times
Jovial
5 years ago
Sorry i mean rename column in that table by using alter command
upvoted 1 times
...
...
...
wariusw
4 years, 3 months ago
changing column name by procedure? You can but why?
upvoted 1 times
wariusw
4 years, 3 months ago
Ok, my bad! :( in MySql you can use "alter" but every mssql helper says u need to use built in procedure.
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...