HomeОбразованиеRelated VideosMore From: The Bad Tutorials

SQL Tutorial - 13: Inserting Data Into a Table From Another Table

445 ratings | 234280 views
In this tutorial we'll learn to use the INSERT Query to copy data from one table into another.
Html code for embedding videos on your blog
Text Comments (55)
Ankush Singh (19 days ago)
this is good example, but how to sync local database to server database using sp or trigger without any program
Raj Kumar (22 days ago)
Nice Sir
ABN WEBTECH (23 days ago)
This NICE
Anji Anjaneyulu (2 months ago)
Thank you for preparing this kind of video.....!!!!!
rahul chavan (2 months ago)
Hello , Nice tutorial. I have one quick question. What if I have 2 Tables. 1) EMP_DATA 2) SALARY_DATA COLUMNS: 1) EMP_DATA ( EMP_ID, First_Name, Last_Name) 2) SALARY_DATA ( EMP_ID, Salary, Dept) Situation: I want to create a new table EMP_DATABASE which has fields EMP_ID, First_Name, Last_Name, Salary, Dept. I want to copy all the data from table EMP_DATA and SALARY_DATA into a newly created table EMP_DATABASE. What should be the syntax for it. I would really appreciate your help. You can also email me on [email protected]
Cris Dabz (3 months ago)
sir how about two table are not in the same database?
Qazi Abaan (3 months ago)
Wil it move data or it copies from one table to another
Qazi Abaan (3 months ago)
Wil it move data or it copies from one table to another
Johnnaveen Abishek (3 months ago)
Hai Sir, Actually, I want some clarification, I have a dynamic table If that table entry how to insert the next table. It should be inserted at a time, In dynamic table create in every month(It ie use of exe) .can you please answer me sir,
Manny P (4 months ago)
Is it possible to use this INSERT command to add a computed column from table 1 (source) to destination? My syntex (shown below) works for calculating running total however, it doesn't work if i try to use same query to insert running total to new table; select t_date, amount, sum(amount) over (order by t_date) as balance from bank order by t_date; If i add one additional line as your video "INSERT INTO new_tb (t_date, amount, balance), the balance column in new_tb is still zero. Any input would be highly appreciated.
IGIDZILA x (5 months ago)
THANK YOU BRUDA
Mikoo Mendoza (6 months ago)
need help on a Sql query
World Channel (6 months ago)
how to insert copy record from same table?
Avichal Ambar (7 months ago)
insert INTO employee(en_cust_id) SELECT id FROM customer where name = 'avi' Error Code: 1364. Field 'emp_id' doesn't have a default value can anybody tell me why i am getting this error? en_cust_id -->fk of employee table 'emp_id'--> pk of employee table 'id'-->is pk of customer table
botr run (7 months ago)
in the previous slide you had us delete emp_info, but in this video you have that table present. You should have had us re-create that table so we can stay in sync with you. Maybe you were just testing us to have us create it again.
Raman Thakur (7 months ago)
Nice video it's very helpful to me thanks
RAHUL KUMAR PAL (8 months ago)
nice vidio It 's very helpful for me
Janjan Alcala (8 months ago)
Hi Sir. I have a problem. I want to insert first the data to my recycle_bin table before I delete it. how can I do that? thank you Sir and Godbless
Ghalem (10 months ago)
thank you
Ashok Kumar (10 months ago)
how we insert record in table from two different table by using mysql
Noor Ch (10 months ago)
Bhai apki wja sa paper acha hugya 😂
Jitendra Mishra (1 year ago)
Is the data insert in another table remains in table from which it is inserted
Solasta Metanoia (1 year ago)
sir I want to copy data from one table to another only if a condition satifies...how to do that? please reply
D_lane (1 year ago)
Can this method be used like a draft table scenario? So, the insert query copies the data over to the live table with the first table taking the data as the 'draft table'?
Shaik khadarvali (1 year ago)
can we the move the data of different table structure in same database
botr run (1 year ago)
in tutorial 11 we dropped emp_info, when was it added back since this tutorial refers to it?
Kaushik Talukdar (1 year ago)
how to insert value in one table and update another table at the same time?
Andrew Sheldon (1 year ago)
Mate, you're getting a bit repetitive. :)
Charlemagne Domingo (1 year ago)
good day sir, is it possible to insert data from one table to another with different number of fields? but i only want to insert the specific data i want to put in.pls reply
Tauseef Khan (5 months ago)
use where condition
Larry (7 months ago)
That was posible
yancie atendido (2 years ago)
can I use this sql code in c#?
Stella-Anne Popoola (2 years ago)
how do I insert telephone number in a table?
Gefie Dela Cruz (2 years ago)
I have a question sir what if i have a 5 records into tb1 and i want to insert only one row into tb2
Samadhan Sonwane (2 years ago)
Use the WHERE clause with PRIMARY KEY.
arix alasian (2 years ago)
Great!!! thanks a lot!!!! it's working on me.. i make my website project and you help me a lot..
Satyaban Ukil (2 years ago)
Sir thanx for your video tutorial. I stay in India where comprehensive books on ms access is not available. I have a simple question, Suppose I have two tables A and B with ID being the relationship key between the two tables. Suppose I update or insert new data in Table A. How that data could automatically be updated in table B. Thanx and Regards, Satyaban, India
suman das (2 years ago)
thank you :)
Raja T (2 years ago)
0 rows created its not work dude ??
Martin Hann (2 years ago)
I'm using Access2013 the SQL you provided at 1:05 did not work.
Dhirendra Giri (2 years ago)
how to load data from one table to multiple table using stored procedure???????????
Thanh Hải Trần (3 years ago)
I Want insert data into two Table in SQL ? Are you help me?
romy lloyd cruz (3 years ago)
Thanks dude, it gave me an idea. Great!
Raja T (2 years ago)
+romy lloyd cruz are u don this??
ada life (3 years ago)
how to use this in php? please help me :(. realy need your help
ritika ritu (3 years ago)
Very nice tutorials.Your all tutorials are enough to learn for sql???
Yana Domi (3 years ago)
Thank you so much!  :) 
Anthony Aguirre (3 years ago)
Good work, good work!
McGavel1 (3 years ago)
This is really fun! Great vid.
Lendrit Sh (4 years ago)
hello friend one question : how to width a column in mysql workbench answer please :D
Thuc Tran Cong (4 years ago)
tks Madhur ! But, I wanna Inserting Data Into a Table From Another Table and add a column in new table :) Can you give me a solution ? :) tks
AntiMassovka (3 years ago)
I have the same question :)
Jess McAnally (4 years ago)
@Suresh MySQL
Suresh Dharavath (5 years ago)
Sir, your tutorials are so nice .... Actually I was listening your shell script tutorial ................ In this tutorial what IDE your using ?
Dheedhify (5 years ago)
Nice.. thank you.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.