Question

In SQL, how do I put one column from one table right next to another column...

In SQL, how do I put one column from one table right next to another column from a different table?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Using Sql query:-

Consider we have a two table "presentTable" and "targetTable".We want to copy a column "presentColumn" from "presentTable" to "targetColumn" of "targetTable".

*Note:-The target table column i.e"targetColumn" should be empty and "presentColumn" should contain data,Then write the following sql query:-

Update targetTable SET targetColumn=(

Select presentColumn from presentTable where presentTable.Id=targetTable.Id

);

Add a comment
Know the answer?
Add Answer to:
In SQL, how do I put one column from one table right next to another column...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How do I set a column attribute with value from another table? I have this manager_specialisation table: CREATE TABLE ma...

    How do I set a column attribute with value from another table? I have this manager_specialisation table: CREATE TABLE manager_specialisation ( specialisation_id NUMBER(4) NOT NULL, specialisation_type VARCHAR(50) NOT NULL ); And I want to update a column in my garage_manager table like this except the specialisation_id is WHERE specialisation_type = 'S'.? UPDATE garage_manager SET specialisation_id=manager_specialisation.specialisation_id WHERE man_id=1 AND garage_email= (SELECT garage_code FROM garage WHERE garage_email = '[email protected]') ;

  • WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the...

    WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. --       Format this column with the last name, a comma, a space, and the first name like this: --       Doe, John --       Sort the result set by last name in ascending sequence. --       Return only the contacts whose last name begins with a letter from M to Z. --  ...

  • (Using Oracle SQL) How do I find the primary key of this table? And then how...

    (Using Oracle SQL) How do I find the primary key of this table? And then how do I consequently drop the primary key from the table? Edit: I was already give this code and it did not work select constraint_name,constraint_type from user_constraint where table_name='CUSTOMER'; Q7 (10 Points) Use ONE SQL statement to find out the name of the primary key constraint defined on Customer table. (Your SQL should return something like SYS_C0021715, numbers on your account may differ.) Then use...

  • In oracle sql, how do I add "not null constraint" at end of create table block...

    In oracle sql, how do I add "not null constraint" at end of create table block and give it a name without using the CHECK constraint? Is it e.g., CONSTRAINT constraintName NOT NULL If so, then how does the statement know which columnName I'm referring to to make NOT NULL? I know that I can do this after declaring the column, what I'm wondering about is how to do this after declaring all the columns.

  • this is sql developer question I just need the format of how to answer question! Create...

    this is sql developer question I just need the format of how to answer question! Create sequences (2) that can be used to number the member ID and group ID values starting with 3 (since you already have 1 and 2). Write an INSERT statement that adds another row to the Groups table, make up a group name. Use the NEXTVAL pseudo column to get the value for the next group ID from the sequence that you created in #5....

  • Hello this is for SQL. How do i only return a row that has a 9...

    Hello this is for SQL. How do i only return a row that has a 9 or a 2 from the invoice_number column?

  • Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName,...

    Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName, City ON Employees; O FIND EmployeeName, City ON Employees; SELECT EmployeeName, City FROM Employees; O RETRIEVE EmployeeName, City FROM Employees; Which SQL statement finds the different cities in which national parks reside with no duplicate rows listed? SELECT DISTINCT city FROM natlpark ORDER BY city; O ORDER BY natlpark DISTINCT city; O ORDER BY city FROM natlpark; O SELECT city FROM natlpark ORDER BY...

  • Put all of your SQL code in a file named grades.sql and submit it below. Download...

    Put all of your SQL code in a file named grades.sql and submit it below. Download the starter code, which contains import_grades.sql and the grades.csv file. Using he import_grades, sql file, create your database and table. - 0 eded. 1 T Une Modify the LOAD DATA INFILE to correct the path to load the grades.csv file, and add/remove LOCAL he only modification you may make to the import_grades.sql or the grades.csv files. The data represents grades for assignments in a...

  • I want to retrun the column name from sql database in php after certain conditions. For...

    I want to retrun the column name from sql database in php after certain conditions. For example the column is Z,H,Y,J and the value for each column is FFA,1,0,1. First I want to compare my input(array) with Z if my input is equal to Z I want to search any column with 1 and retun the column name by array.

  • please put them in the right column. I just guessed on them. Exercise 1 Experiment 1...

    please put them in the right column. I just guessed on them. Exercise 1 Experiment 1 Data Table 1 Data Table 1: Lab Safety Equipment Alternatives Shower or Sink Paper Towels eye wash station First aid kit Well Ventilated Area No Substitution Fume hood Fire extinguisher Laboratory shower Spill containment kit Safety goggles

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT