致力於社交網絡項目。只需要將sql語句放在一起來創建表,並且需要一些關於如何完成這些操作的幫助,以及這些關係如何在表之間起作用。SQL語句寫入表?
drop table users;
drop table intrest;
drop table friendships;
create table users(
id INT,
Fname char(15),
Lname char(15),
email char(20),
street char(15),
state char(2),
zip INT,
age INT,
gender char (2),
phone INT,
Password char(15),
primary key (id);
create table Instrests(
id INT,
create table friendships(
這可以用三個表
到目前爲止,我有這個工作完成。
drop table users;
drop table intrest;
drop table friendships;
create table users(
id INT,
Fname char(15),
Lname char(15),
email char(20),
street char(15),
state char(2),
zip INT,
age INT,
gender char (2),
phone INT,
User_password char(15),
primary key (id)
foriegn key (intrest_id) references intrest(id)
);
create table Intrests(
id INT,
description char(30),
Primary key (id),
foreign key (users_id) references users(id)
);
create table User_intrest(
foreign key (user_id) references user(id),
foreign key (intrest_id) references intrest(id)
);
create friendships(
User_1_id INT,
User_2_id INT,
status Char(20),
foreign key (user_id) references user(id)
);
什麼問題? – Zepplock 2011-04-05 17:40:53
這看起來不像一個完整的問題...請閱讀http://stackoverflow.com/questions/how-to-ask – 2011-04-05 17:41:25
請添加您的整個代碼! – 2011-04-05 17:42:59