Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can we change the name of a column of a table?

Answers were Sorted based on User's Feedback



How can we change the name of a column of a table?..

Answer / vipul dalwala

ALTER TABLE table_name change OLD_COLUMN_NAME
NEW_COLUMN_NAME VARCHCHAR(100) NULL;

Is This Answer Correct ?    18 Yes 3 No

How can we change the name of a column of a table?..

Answer / tushar

ALTER TABLE table_name change OLD_COLUMN_NAME
NEW_COLUMN_NAME VARCHAR(255) NULL;

Is This Answer Correct ?    6 Yes 0 No

How can we change the name of a column of a table?..

Answer / nithya

changing a column name differs from the type of database we use.

MySQL:
ALTER table customer CHANGE Address Addr char(50);

Oracle:
ALTER table customer RENAME COLUMN Address TO Addr;

SQL Server:
It is not possible to rename a column using the ALTER TABLE
statement in SQL Server. Use sp_rename instead.

Is This Answer Correct ?    3 Yes 0 No

How can we change the name of a column of a table?..

Answer / shweth

we can use ALIAS function for this
select tree AS plant
from table;
or simply we can skip writing AS but shoudnt write a comma
between the old and new column names.

Is This Answer Correct ?    5 Yes 4 No

How can we change the name of a column of a table?..

Answer / owais masood

RENAME cannot be used to change the column name, however, it
is used to change the table or database name. However the
CHANGE is used to to rename a column with the su=yntax given
above by vipul (Answer 2)

Is This Answer Correct ?    1 Yes 0 No

How can we change the name of a column of a table?..

Answer / chandrakant agrawal

ALTER TABLE <owner_name.tab_name> RENAME COLUMN <old_name>
TO <new_name>;


We can also modify the datatype,size of the column using
command alter table

Is This Answer Correct ?    1 Yes 6 No

How can we change the name of a column of a table?..

Answer / chaithra.t

ALTER TABLE tablename RENAME COLUMN old_columnname TO
new_columnname;

above is to change the column name of the table.
In case if u want to change the table name then:

ALTER TABLE tablename RENAME TO new_tablename;

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More MySQL Interview Questions

SELECT country,city FROM customers GROUP BY country ORDER BY city DESC

5 Answers   HCL,


What, if a table has one column defined as TIMESTAMP?

0 Answers  


What is logs in mysql?

0 Answers  


How to do login in mysql with unix shell.

0 Answers  


How do I download mysql?

0 Answers  


what is JOIN? Give example & types of join?

14 Answers   iMedia, Millennium, RAM Software, Satyam,


Is mysql workbench a dbms?

0 Answers  


Write a query to fetch common records between two tables using mysql?

0 Answers  


Please suggest me any course and institute which provide training on the below skills. • Knowledge of data extraction concepts and tools • QMF (query management facility)queries • Experience and expertise in QMF queries • Excellent ability to write, read, and interpret QMF queries against the Source Data Warehouse base level (daily and monthly) and month-end affinity comp tables • RDBMS & ER • Knowledge of Relational Databases (RDBMS) and Entity Relationship (ER) Diagrams • SOURCE Data Warehouse • Experience and expertise in Source Data Warehouse or data warehouses on the mainframe. • MS SQL Server • Experience in MS SQL Server • Excellent skill in writing/interpreting SQL queries and running Data Transformation Services (DTS) or open query packages. • Knowledge of writing/interpreting Visual Basic code.

1 Answers  


Explain Normalization concept?

2 Answers   Inuva,


How To see all the tables from a database of mysql server.

0 Answers  


How to create triggers in MySQL?

1 Answers  


Categories