How to update a data for the views in the relational data
base schema
Answer Posted / 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 View All Answers
1. Consider the following code in our example assembly language: ; an example bit of assembly code ROOT: W FATHER FATHER: W SON1 W SON2 SON1: W NIL W NIL ; ---------------------- SON2: W GRANDSON W NIL GRANDSON: W NIL W NIL NIL = 0 Assemble this code carefully following the two pass model, and show the symbol table at the point marked by the dashed line during each pass.
Write a program to find duplicate number from array in minimum time complexity.
Hai, My name is nisha.I have NIC exam.If anybody Knows NIC previous paper pattern pls send me to nishanairp@gmail.com
can we retrieve only integer/String type columns from a table,if yes how?
Write a pseudo code to evaluate a number to any base given (2...16) based on the input. Number greater than 9 should be given as A-F for 10-15.
Give examples of macro quoting function?
what is the difference between uservariables and systemvariables (in Environmental variables)???
If u need any fake experience certificate in software side, contact me at: vikramyadhav@gmail.com
3. What is the difference between testing and Quality Assurance?
Hello Experts, What is the difference between move and move corresponding exactly? please post me asap
Bonjour, svp je veut voir comment envoyer un mail en java et comment changer le droit d'accé d'un fichier en java: de lecture en lecture/écriture et merci d'avance ;)
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number
What is the first message line that any language learning prints on the screen? and why?
shall we execute our java programmes in jre
what is delegate and delegation model give the real live example on delegate model