Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit a Table

Status
Not open for further replies.

FSEdge

Technical User
May 26, 2001
63
US
Can anyone offer insight as how to edit or remove rows and or columns in a table?

I am just starting to learn MySQL. Please forgive me if this is questions is rather simple.

Thanks

FSEdge
 
removing rows from a table involves the use of the DELETE statement. you specify the table and types of records you want deleted.

Code:
delete from myTable

will delete all rows from the table named myTable.

Code:
delete from myTable
 where user_first_name = 'Cory'

will delete all rows that have a value of 'Cory' in the user_first_name column from the table named myTable

removing columns involves using the ALTER statement.

Code:
alter myTable
 drop column user_first_name

removes the user_first_name column from the myTable table.

these are very basic functional aspects of all SQL engines, not just MySQL. I suggest you buy a book and use resources such as for more information.



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
FSEdge-

I would take Flava's advice and read up on the basic functionality of standard T-SQL. Practive running queries and manipulating data around. From what you said, you are already trying to learn it. Good for you. But, your question is very basic in nature, one of the foundation tools for learning SQL.


Kevin
--------------------------
SELECT * FROM users WHERE clue > 0
(0 rows affected)
 
Gentlemen, thanks for your response to my question. I've since spent a lot of time at mysql.com reading over documents.

FSEdge
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top