Coder Baba
Open in Telegram
Everything about programming for beginners. 1 and only official telegram channel of CODERBABA India. Content: .NET Developer, Programming (ASP. NET, VB. NET, C#, SQL Server), & Projects follow me https://linktr.ee/coderbaba *Programming *Coding *Note
Show more2 183
Subscribers
-124 hours
-87 days
-1730 days
Posts Archive
2 183
Create Table tblCountry
(
CountryId Int Primary Key,
County Varchar(30)
)
Create Table tblcountryState
(
StateId Int Primary Key,
CountryId Int Foreign Key References tblCountry(CountryId),
State Varchar(30)
)
Create Table tblstateCity
(
CityId Int,
StateId Int Foreign Key References tblcountryState(StateId),
City Varchar(30)
)
-------------------------------
Insert Into tblCountry Values(101,'India')
Insert Into tblCountry Values(102,'USA')
Insert Into tblCountry Values(103,'Pakistan')
Insert Into tblcountryState Values(1001,101,'U.P')
Insert Into tblcountryState Values(1002,101,'Kerala')
Insert Into tblcountryState Values(1003,101,'Kasmir')
Insert Into tblcountryState Values(2001,102,'Colorado')
Insert Into tblcountryState Values(2002,102,'Delaware')
Insert Into tblcountryState Values(2003,102,'Georgia')
Insert Into tblcountryState Values(3001,103,'Punjap')
Insert Into tblcountryState Values(3002,103,'Baluchistan')
Insert Into tblcountryState Values(3003,103,'Sind')
Insert Into tblstateCity Values(11,1001,'Kanpur')
Insert Into tblstateCity Values(12,1001,'Varanasi')
Insert Into tblstateCity Values(21,1002,'Kochi')
Insert Into tblstateCity Values(22,1002,' Thiruvananthapuram ')
Insert Into tblstateCity Values(31,1003,'Jammu')
Insert Into tblstateCity Values(32,1003,'Manali')
Insert Into tblstateCity Values(41,2001,'Alabama')
Insert Into tblstateCity Values(42,2001,'Arizona')
Insert Into tblstateCity Values(51,2002,'Bellefonte')
Insert Into tblstateCity Values(52,2002,'Felton')
Insert Into tblstateCity Values(61,2003,'Rustavi')
Insert Into tblstateCity Values(62,2003,'Kobulati')
Insert Into tblstateCity Values(71,3001,'Lahore')
Insert Into tblstateCity Values(72,3001,'Faisalabad')
Insert Into tblstateCity Values(81,3002,'Quetta')
Insert Into tblstateCity Values(82,3002,'Nasirabad')
Insert Into tblstateCity Values(91,3003,'Krachi')
Insert Into tblstateCity Values(92,3003,'Mirpur khas')
select * from tblCountry
select * from tblcountryState
select * from tblstateCity
