sql - Need Help To Create DataBase? -


i going create database in sql server 2014 have problem .

a need use option : when user want register , select country , city of country display , select .

for example : when user select u.s.a , display (newyourk , washington , . . . )

pic of prog

create table orders (     orderid int identity (1,1) not null primary key,     fname varchar(50) not null,     lname varchar(50) not null,     tel varchar(15),     counts int not null,      daysid int not null,     countryid int not null,     cityid int not null,     address varchar(1024) not null,     foreign key (daysid) references weekdays(daysid),     foreign key (countryid) references country(contryid),     foreign key (cityid) references city(cityid) ) go create table weekdays (     daysid int identity (10000001,1) not null primary key,     daysname varchar(50) not null ) go create table country (     countryid int identity (2000000,1) not null primary key,     countryname varchar(100) ) create table city (     cityid int identity (2000000,1) not null primary key,     cityname varchar(100) ) 

for must have foreign key of countryid in city table can fetch cities of usa

create table city (     cityid int identity (2000000,1) not null primary key,     cityname varchar(100)     countryid int      foreign key (countryid ) references country(countryid ) )  --fetch records  select * form city countryid=1 -- or whatever id of country 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -