From the course: Database Foundations: Data Structures

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a relationship between tables

Create a relationship between tables

From the course: Database Foundations: Data Structures

Start my 1-month free trial

Create a relationship between tables

- [Instructor] Adding the foreign key column to a table is the first step in creating a relationship. Now, we need to tell the RDBMS about the link between our orders and customers tables so that it can enforce the connection between rows. Make sure that you have the two trees database selected in the SQL server instance, and then come up to file and open file. In the chapter four folder, find the relationship dot SQL file and open it up. Now, before we go on, you might have a number of red underlines that are appearing throughout this script. As your data studio keeps track of the object names that you've used in your databases so that it can help you write commands, but it sometimes needs to be manually updated. Right click anywhere here on the main portion of the screen and choose command pallet from the pop-up menu. Then do a search for refresh IntelliSense cache. When you find it, go ahead and give that a click and as…

Contents