Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Database Foundations Introduction to Data, Databases and SQL Inserting Data

Diego Salazar
Diego Salazar
2,206 Points

How do I insert values in tables that share a column?

I do get this overview, but what if both tables share a column, how can I insert into data?

1 Answer

You specifying the table name in your insert statement - so the insert query only affects that table.

However, if you are really concerned you can use dot notation to represent a specific column in a table.

Two tables (A & B) have the same column (name)

A.name = name column in table A B.name = name.column i table B

(Dot notation like this comes in very handy in join statements)