March 2001
Intermediate to advanced
640 pages
14h 9m
English
Now that you have written a join, let's take a moment to understand how joins work.
Listing 5.1 shows the code to create and populate two small tables in an automobile database. The first table is a list of car Makes; that is, manufacturers of automobiles. The second table is a list of Models. Each model corresponds to an entry in the Makes table.
1: create table Makes ( 2: MakeID int identity primary key, 3: MakeDescription nvarchar(10) not null 4: ) 5: go 6: create table Models ( 7: ModelID int identity (101,1) primary key, 8: MakeID int not null references Makes (MakeID), 9: ModelName nvarchar(20) not null 10: ) 11: ... |
Read now
Unlock full access