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 chavan.rahul70595@gmail.com
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,
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.
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.
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
35 responses to “SQL Tutorial – 13: Inserting Data Into a Table From Another Table”
Amazing work my brother!
How to Insert Into Table from table another without duplication in sql؟
this is good example, but how to sync local database to server database using sp or trigger without any program
Nice Sir
This NICE
Thank you for preparing this kind of video…..!!!!!
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 chavan.rahul70595@gmail.com
sir how about two table are not in the same database?
Wil it move data or it copies from one table to another
Wil it move data or it copies from one table to another
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,
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.
THANK YOU BRUDA
need help on a Sql query
how to insert copy record from same table?
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
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.
Nice video it's very helpful to me thanks
nice vidio It 's very helpful for me
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
thank you
how we insert record in table from two different table by using mysql
Bhai apki wja sa paper acha hugya 😂
Is the data insert in another table remains in table from which it is inserted
sir I want to copy data from one table to another only if a condition satifies…how to do that? please reply
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'?
can we the move the data of different table structure in same database
in tutorial 11 we dropped emp_info, when was it added back since this tutorial refers to it?
how to insert value in one table and update another table at the same time?
Mate, you're getting a bit repetitive. 🙂
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
can I use this sql code in c#?
how do I insert telephone number in a table?
I have a question sir what if i have a 5 records into tb1 and i want to insert only one row into tb2
Great!!!
thanks a lot!!!!
it's working on me..
i make my website project and you help me a lot..