Demo entry 6663200

Create table

   

Submitted by anonymous on Nov 29, 2017 at 14:10
Language: MySQL. Code size: 2.8 kB.

create table CLIENT (
clientnumber char(30) not null,
clntname char(30) not null,
clntphoneNumber char(30) not null,
ssn char(30) not null,
clntaddress char(30) not null,
aproach char(30) not null,
clntId char(30) not null,
clntPassword char(30) not null,
clntemail char(30) not null,
primary key(clientnumber));

create table CENTER (
centernumber char(30) not null,
ctrname char(30) not null,
ctrphoneNumber char(30) not null,
ctraddress char(30) not null,
ctremail char(30) not null,
contractdate date not null,
contractenddate date not null,
crtID char(30) not null,
crtPassword char(30) not null,
cost int(30) not null,
primary key(centernumber));

create table CONTENTS (
contnumber char(30) not null,
contname char(30) not null,
contdiscription char(30) not null,
contexample char(30) not null,
primary key(contnumber));

create table PROBLEM (
probnumber char(30) not null,
probname char(30) not null,
probdiscription char(30) not null,
probexample char(30) not null,
primary key(probnumber));

create table TECHNIQUE (
technumber char(30) not null,
techname char(30) not null,
techdiscription char(30) not null,
primary key(technumber));

create table COUNSELOR (
counnumber char(30) not null,
centernumber char(30) not null,
technumber char(30) not null,
probnumber char(30) not null,
contnumber char(30) not null,
counname char(30) not null,
counage int(30) not null,
counphonenumber char(30) not null,
counemail char(30) not null,
field char(30) not null,
primary key(counnumber),
FOREIGN KEY(centernumber) REFERENCES center(centernumber),
FOREIGN KEY(technumber) REFERENCES technique(technumber),
FOREIGN KEY(probnumber) REFERENCES problem(probnumber),
FOREIGN KEY(contnumber) REFERENCES contents(contnumber));

create table RESERVATION (
reservnumber char(30) not null,
clientnumber char(30) not null,
centernumber char(30) not null,
counnumber char(30) not null,
contdate char(30) not null,
counsdate char(30) not null,
contcondition char(30) not null,
primary key(reservnumber),
FOREIGN KEY(centernumber) REFERENCES center(centernumber),
FOREIGN KEY(clientnumber) REFERENCES client(clientnumber),
FOREIGN KEY(counnumber) REFERENCES counselor(counnumber));

create table QUESTION (
qtnumber char(30) not null,
clientnumber char(30) not null,
qtcontents char(30) not null,
qttitle char(30) not null,
qtdate date not null,
primary key(qtnumber),
FOREIGN KEY(clientnumber) REFERENCES client(clientnumber));

create table FEEDBACK (
fbnumber char(30) not null,
reservnumber char(30) not null,
fbcontents char(30) not null,
fbtitle char(30) not null,
fbrating int(30) not null,
fbdate date not null,
primary key(fbnumber),
FOREIGN KEY(reservnumber) REFERENCES reservation(reservnumber));

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).