Click here to Skip to main content
15,921,959 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello
below is my tables
SQL
create table school1(school_id int identity(1,1) NOT NULL primary key,school_name varchar(250));
create table branch1(branch_id int identity(1,1) NOT NULL primary key,School_id int foreign key references school1(School_id),branch_name varchar(100));
create table class1(class_id int identity(1,1) primary key NOT NULL, class_name varchar(20),branch_id int foreign key references branch1(branch_id),course_year varchar(10),createddateandtime date)
create table section1(section_id int identity(1,1) primary key NOT NULL,section_name varchar(20),class_id int foreign key references class1(class_id),section_year varchar(10),creatddateandtime date)


the class1 table contain foreign key from branch table(branch_id) but in the database diagram there is no link between them

What is the problem im my table
Posted
Comments
Sergey Alexandrovich Kryukov 17-Jul-12 16:21pm    
Why don't you think there is no "link" between them? There is a relation.
Probably by "diagram" you mean something called "database schema".
--SA
Tejas Vaishnav 19-Jul-12 2:11am    
I tried to create temp db with your above query.
and then create database diagram from sqlserver then it will show the link between all tables.

like school -> branch -> class -> section

its working fine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900