How to update a data for the views in the relational data
base schema



How to update a data for the views in the relational data base schema..

Answer / poopapule

The UPDATE statement allows you to update a single record
or multiple records in a table.

The syntax for the UPDATE statement is:

UPDATE table
SET column = expression
WHERE predicates;



Example #1 - Simple example

Let's take a look at a very simple example.

UPDATE suppliers
SET name = 'HP'
WHERE name = 'IBM';

This statement would update all supplier names in the
suppliers table from IBM to HP.



Example #2 - More complex example

You can also perform more complicated updates.

You may wish to update records in one table based on values
in another table. Since you can't list more than one table
in the UPDATE statement, you can use the EXISTS clause.

For example:

UPDATE suppliers
SET supplier_name = ( SELECT customers.name
FROM customers
WHERE customers.customer_id = suppliers.supplier_id)
WHERE EXISTS
( SELECT customers.name
FROM customers
WHERE customers.customer_id = suppliers.supplier_id);

Whenever a supplier_id matched a customer_id value, the
supplier_name would be overwritten to the customer name
from the customers table.



-pooja papule

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

which is the best institute for testing tools in hyderabad?

1 Answers  


hi i m deepak my shedule for NIC pi is 17 Apr please contact me if anybody has interview on same day or give me some idea who have faced

0 Answers  


how to data grid use in data bind?

0 Answers   HCL,


how to display xisheet in list box in c# .net

0 Answers  


merge sort time complexity

6 Answers   BFL, CDAC, IBM, Jawaharlal Nehru Technological University JNTU,






how can i create report in abap to insert data in table pa0002 using insert command

0 Answers  


preorder of A*(B+C)/D-G

6 Answers   BFL,


what is best way to create a Thread class & why?

0 Answers  


How to display questions one by one in jsp and I wants to store the answers in my database?

0 Answers  


is it possible to desable particular parameter of the normal orcle report based on some condition ?????? if yes,wht is the function for desabling a parameter...

0 Answers  


Wats the name of the first os

2 Answers  


differenc between visual studio 2005,2008 & 2010?

2 Answers  


Categories