Question

What are 2 ways I could insert rows to a table, using the SELECT statement.

What are 2 ways I could insert rows to a table, using the SELECT statement.

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

Answer:-

Method:1  INSERT INTO table_name SELECT * FROM another_table;   
Method:2  INSERT INTO table_name (id,name,marks)  SELECT id,name,marks FROM another_table;
Add a comment
Know the answer?
Add Answer to:
What are 2 ways I could insert rows to a table, using the SELECT statement.
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
  • SQL Homework exercises: 1. Write INSERT statements that add two rows to the Members table for...

    SQL Homework exercises: 1. Write INSERT statements that add two rows to the Members table for member IDs 1 and 2, two rows to the Groups table for group IDs 1 and 2, and three rows to the Group_Membership table: one row for member 1 and group 2; one for member 2 and group 1; and one for member 2 and group 2. Then, write a SELECT statement that joins the three tables and retrieves the group name, member last...

  • 1.What is the return value if the user try to do the following: SELECT TRUNC (65.73,-2)...

    1.What is the return value if the user try to do the following: SELECT TRUNC (65.73,-2) FROM DUAL; Select one: a. 60 b. 00 c. 0 d. 600 2.Supposed that the user uses the ff SELECT statement: what will be the possible output. SELECT GRADE AS STUDENT MARK FROM GRADE_REPORT; Select one: a. Error because of the keyword AS. b. Error because of missing “” mark. c. Will display the column GRADE rename as STUDENT MAK d. Will display all...

  • 1. Write an INSERT statement that adds this row to the Categories table: CategoryName: Brass Code...

    1. Write an INSERT statement that adds this row to the Categories table: CategoryName: Brass Code the INSERT statement so SQL Server automatically generates the value for the CategoryID column. 2. Write an UPDATE statement that modifies the row you just added to the Categories table. This statement should change the Category Name column to “Woodwinds”, and it should use the CategoryID column to identify the row. 3.Write an INSERT statement that adds this row to the Products table: ProductID:...

  • How do I combine these two SELECT query into one INSERT?Selecting a value from different tables...

    How do I combine these two SELECT query into one INSERT?Selecting a value from different tables in ORACLE? I inserted a row into vehicle_unit by using INSERT this way: INSERT INTO vehicle_unit(vunit_id,vunit_purchase_price,vunit_exhibition_flag,vehicle_insurance_id,vunit_rego, garage_code) SELECT '3',50000.00, 'R', 'sports-ute-449-12b ', 'RD3000', garage_code FROM garage WHERE garage_email ='melbournec@rdbms.example.com '; BUT now I do not want to manually enter sports-ute-449-12b. I want to select it from vehicle_detail table using the vehicle_title like this: SELECT vehicle_insurance_id FROM vehicle_detail WHERE vehicle_title= 'Toyota Hilux SR Manual 4x2...

  • 3. Write a script that adds rows to the database that you created in exercise 2....

    3. Write a script that adds rows to the database that you created in exercise 2. Add two rows to the Users and Products tables. Add three rows to the Downloads table: one row for user 1 and product 2; one row for user 2 and product 1; and one row for user 2 and product 2. Use the SYSDATE function to insert the current date into the download_date column. Use the sequences created in the previous exercise to get...

  • Select all rows from the new table you''ve just created (there should only be the two...

    Select all rows from the new table you''ve just created (there should only be the two rows you just inserted!). Order the output by your table''s primary key; format all columns using CAST, CONVERT and/or STR.

  • Insert the bottom two rows to each table we made in class and update the two...

    Insert the bottom two rows to each table we made in class and update the two in gray in stock and product tables. Provide your SQL code in notepad or word. You can include a screen shot of your select statements showing database populated with your name in ure showing your account Product Product Name Manufacturer 1 102 103 509 Product Product Description Ergonomic keyboard with rest pad HP Model 3456 5x7 inch monitor with stylus Series 5 Pink 32G...

  • Hello, I'm working on inserting data into a table using MySQL and Python on my Windows...

    Hello, I'm working on inserting data into a table using MySQL and Python on my Windows OS laptop; and I am asked to modify the script so that it executes an insert query in one of my database tables. I am also asked to print the table before and after I execute this query in order to ensure the new information was inserted into the table. I'd like to INSERT INTO my EMPLOYEE table. The columns are employee_id, employee_password, order_id...

  • How many rows in the following SELECT statement will return a null prerequisite? SELECT prerequisite, COUNT(*)...

    How many rows in the following SELECT statement will return a null prerequisite? SELECT prerequisite, COUNT(*) FROM course WHERE prerequisite IS NULL GROUP BY  prerequisite; None One Multiple

  • PRINT Lab Week 2, Question 1 What channel is SYFY? --------------------- Write a SELECT statement that...

    PRINT Lab Week 2, Question 1 What channel is SYFY? --------------------- Write a SELECT statement that finds the channels named SYFYP and SYFYHDP in the CHANNEL table of the TV database. Use a WHERE clause with an OR statement to return only these two channels. Display only the ChannelNumber and DisplayName columns. Hint: Correct results will look like this (note that DisplayName is 200 characters wide, so I''ve edited a bit): ChannelNumber DisplayName ------------- ----------- 59 SYFYP 1411 SYFYHDP '...

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