4,523 views
4 votes
4 votes

The 'command' used to change contents of one database using the contents of another database by linking them on a common key field?

  1. Replace
  2. Join
  3. Change
  4. Update

4 Answers

3 votes
3 votes

ans is (b)

join clause combines columns from one or more tables in a relationaldatabase. It creates a set that can be saved as a table or used as it is. A JOIN is a means for combining columns from one (self-table) or more tables by using values common to each.

1 votes
1 votes

Answer is B 

Replace command in sql :  Replaces all occurrences of a specified string value with another string value

Change : I don't think any command in db is there with Change key word

Update : Update a record in table

0 votes
0 votes
I guess the answer is b)join .

But join does not change the contents of the database
0 votes
0 votes
D. Update
 
 
Consider a situation:
A table named as USER_DATA is there which contains user details. This table has one column(along with other columns) named as  IS_ACTIVE which contain ‘0’ for a user, when a user will be in-active.
One other table is there named as BLOG_DETAILS which contains columns asAUTHOR_ID, IS_ACTIVE and other column to keep blog details.
Now if we want to run a script which should make column IS_ACTIVE = 0 in theBLOG_DATA table for in-active users. Here, we need a sql script which will containUPDATE with JOIN.
 
BLOG_DETAILS->AUTHOR_ID is foreign key which refers to the primary key USER_DATA->USER_ID
 
We can write the following query
 
UPDATE BLOG_DETAILS SET IS_ACTIVE = 0 FROM BLOG_DETAILS BD INNER JOIN USER_DATA UD ON UD.USER_ID = BD.AUTHOR_ID AND UD.IS_ACTIVE = 0
 
and we are done…
Answer:

Related questions

5 votes
5 votes
2 answers
1
go_editor asked Jun 15, 2016
5,609 views
Which of the following contains complete record of all activity that affected the contents of a database during a certain period of time?Transaction logQuery languageRepo...
6 votes
6 votes
5 answers
2
Desert_Warrior asked Jun 3, 2016
4,280 views
A locked database file can beAccessed by only one userModified by users with the correct passwordUsed to hide sensitive informationUpdated by more than one user
5 votes
5 votes
2 answers
3
Anuanu asked May 30, 2016
3,867 views
Purpose of 'Foreign Key' in a table is to ensureNull IntegrityReferential IntegrityDomain IntegrityNull and Domain Integrity