create table Equipment (
Equipmenttype nvarchar(1,
Description nvarchar(10),
Primary Key (Equipmenttype)
)
Create table Room (
RoomID nvarchar(8),
Capacity numeric(3),
Roomtype(fk,nvarchar(2)
)
我想创建如下表...
create table RoomEquipment(
(RoomID here)
(Equipmenttype here)
但Equipmenttype
是不是主键。
号不能创建一个外键,只是任何列。这没有任何逻辑意义。当然在你的例子中,你声明EquipmentType是主键。 –
正如我所见的Equipmenttype id PK。 RoomID不是PK。 –
如果你想这样做,那么你已经发现你的数据库设计有缺陷。 – Tomalak