好桌子设计...... [英] good table design...

查看:75
本文介绍了好桌子设计......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我正在设计一个车辆类型表,没有什么特别的,只是一个

独特车辆类型的清单,如卡车,货车,自行车,摩托车,飞机,拖拉机

等等


对于桌面设计我建议使用一个带有字段名称的单列表

名为vehicle_type,这将包含车辆类型。


这将是


vehicle_type

汽车

自行车

拖拉机

飞机

卡车

货车

blah

blah

blah


这样可以吗?或者有更好的方法吗?


谢谢,


td。

Hello,

I am designing a table of vehicle types, nothing special, just a list of
unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor
etc etc

For the table design I am proposing a single column table with a field name
called vehicle_type and this will contain the vehicle type.

Sot it will be

vehicle_type
car
bike
tractor
plane
truck
van
blah
blah
blah

Is this ok? Or is there a better way to do it?

Thanks,

td.

推荐答案

>>对于表格设计,我建议使用名为vehicle_type的

字段[原文如此]名称的单列表,这将包含车辆

类型......这样可以吗? <


当然,如果你记得把一列作为主键。它是奇怪的,只是在空间中没有任何东西挂在那里,

但这是合法的。字段不像列。
>> For the table design I am proposing a single column table with a
field [sic] name called vehicle_type and this will contain the vehicle
type... Is this ok? <<

Sure, if you remember to make the one column the primary key. It is
weird just hanging out there in space without anything in the schema,
but it is legal. And fields are not anything like column.


感谢您的回复。


完全是话题,但是什么是'sic' ' 意思?我在网上和印刷品上都看到了这个地方




谢谢,


TD 。

" - CELKO - " < JC ******* @ earthlink.net>在消息中写道

news:18 ************************** @ posting.google.c om ...
Thanks for your reply.

Totally of topic but what does ''sic'' mean? I see this all over the place
both on the web and in print.

Thanks,

TD.
"--CELKO--" <jc*******@earthlink.net> wrote in message
news:18**************************@posting.google.c om...
对于表格设计,我建议使用
For the table design I am proposing a single column table with a


字段的单个列表[原文]名称为vehicle_type,这将包含车辆
类型......这可以吗? <

当然,如果你记得把一列作为主键。在架构中没有任何东西的情况下,只是在空间里闲逛很奇怪,
但它是合法的。并且字段不像列。


field [sic] name called vehicle_type and this will contain the vehicle
type... Is this ok? <<

Sure, if you remember to make the one column the primary key. It is
weird just hanging out there in space without anything in the schema,
but it is legal. And fields are not anything like column.



描述表的最佳方式是DDL:


CREATE TABLE车辆(vehicle_type VARCHAR(20)PRIMARY KEY)


这个没有任何问题,但你需要考虑它在

架构中的位置整个而不是孤立。 Vehicle_type可能不一定

作为其他表中的外键是合适的或方便的。


-

David Portas

SQL Server MVP

-
Best way to describe a table is as DDL:

CREATE TABLE Vehicles (vehicle_type VARCHAR(20) PRIMARY KEY)

Nothing wrong with this on its own but you need to consider its place in the
schema as a whole rather than in isolation. Vehicle_type may not necessarily
be appropriate or convenient as a foreign key in other tables.

--
David Portas
SQL Server MVP
--


这篇关于好桌子设计......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆