Find jobs | Company-wise jobs
Jobseekers | Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Interview Q&A Tutorials .NET Java Soft skills CV GD Work from home IT practice test MBA practice test FAQs in PDF Books Jobs FAQs
Interview questions                                 
MySQL interview
MySQL FAQs
Test your MySQL skills!
MySQL defined
MySQL SELECT Statement
MySQL sorting data
MySQL filtering
MySQL operator
MySQL searching
MySQL concatenating fields
MySQL text manipulation
MySQL date time manipulation
MySQL numeric manipulation
MySQL Group by
MySQL table
MySQL data type
MySQL sequences
MySQL indexes
MySQL subquery
MySQL joins
MySQL union
MySQL full text searching
MySQL insert statement
MySQL updating & deleting data
MySQL views
MySQL stored procedures
MySQL cursors
MySQL triggers
MySQL transactions
MySQL optimizing performance
MySQL security management
MySQL globalization & localization
MySQL database maintenance
  
PHP
Database concepts
Oracle
Sql server
Biztalk
Sharepoint
Notification services
Reporting services
Service-oriented architecture
Data warehousing
 

MySQL manipulating data


MySQL - updating and deleting data

<<Previous  Next>>

Updating Database Data syntax with an example.
Ignoring Update Errors syntax with an example.
Deleting Database Data syntax with an example.
List out guidelines for updating and deleting data in MySQL.

MySQL updating and deleting data - Dec 13, 2008 at 22:00 PM by Rajmeet Ghai

Updating Database Data syntax with an example.

Update: Update statement is used to update existing data (row) in a table. It is used to update some column value by specifying a condition.

Syntax:
Update table_name
Set column_name1= ‘value’, column_name2=’value2’
Where column_name3=’value3’

Example:
Update customer
Set first_name=’john’
Where last_name=’james’;

Ignoring Update Errors syntax with an example.

Using the IGNORE keyword, update statement is executed and does not abort even if it encounters any errors. If any rows for which duplicate key issues occur they are ignored and rows which may cause any data conversion errors are updated with the closest values.

Syntax:

Update IGNORE table_name
Set column_name1= ‘value’, column_name2=’value2’
Where column_name3=’value3’

Deleting Database Data syntax with an example.

The database can be deleted using the DROP DATABASE syntax. It drops all tables. The user needs the DROP privilege to drop the database.

Example:

DROP DATABASE IF EXISTS sample;

Here, the IF EXISTS is used to prevent errors in case the database does not exist.

List out guidelines for updating and deleting data in MySQL.

  • Updating and deleting data must be avoided without a where clause
  • It should be ensured that every table has a primary key
  • Before updating or delete, use the select clause to ensure the right data is returned
  • The database enforced referential integrity must be obeyed to avoid the deletion of rows that have data in other tables related to them.

<<Previous  Next>>

 
Want to be hunted by potential employers? Just submit your key skills!

Popular FAQs

.NET .Net Architecture ADO.NET Java Oracle C#.NET
VB.NET DOT.NET AJAX ASP.NET NET Framework OOPS in .NET
C++ Sql Server Data warehousing EJB MySQL Linux
PHP UML Networking Testing XML  
 
Copyright © 2008 - 2010 CareerRide.com. All rights reserved.