Join Simon Allardice for an in-depth discussion in this video Creating relationships in SQL Server Management Studio, part of SQL Server 2008 Essential Training.
I am going to go ahead and describe a one-to- many relationship between two of my own tables.…So I have two very-very simple tables here.…I have a product table, which has a few products in it right now.…It's got a ProductID as the unique key, the primary key for this.…That's automatically incrementing, ranging from roughly 1000 through 1013 right now, and…I also have an OrderItem table.…This itself has its own primary key, OrderItemID, that I don't really care…about, but it's got a place for a ProductID and this is going to become the foreign key.…
I'd like to be able to create multiple order items for each product so that…ProductID 1001 can be used several times if I deem it necessary.…That means our many-to-one relationship is one product, many order items.…So how do I make it?…Well I am going to close down these tables.…There are a couple of different ways I can do this.…One way would be to go to the Database Diagrams area, add a new satabase…diagram, grab the two tables that I'm interested in, OrderItem and Product, and I…
- Using T-SQL (Transact-SQL)
- Managing databases with SQL Server Management Studio
- Understanding database normalization
- Using SELECT statements
- Building indexes
- Monitoring database size and integrity
- Backing up and restoring databases
- Creating functions and stored procedures
- Managing database permissions
- Creating and formatting reports
- Adding charts to reports
- Creating and executing a simple SSIS package
Skill Level Beginner
1. Getting Started
2. Installing SQL Server 2008 R2
3. Tools and System Databases
SQL Server system databases2m 22s
4. Creating Databases
5. Importing Existing Data
6. Retrieving Data with SQL
7. Inserting and Updating Data
8. SQL Functions
9. Stored Procedures and Transactions
10. Core Administration Tasks
11. Backing Up and Restoring
12. Security Features
13. Reporting Services
14. Integration Services
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.