创建一个简单的数据库模式

发布于 2024-08-03 09:42:27 字数 72 浏览 9 评论 0原文

我是 SQL 新手,需要一些帮助来为我的程序创建数据库架构,该架构为我的家庭网络管理和安装程序。是否有创建数据库模式的指南/教程?

I'm new to SQL and could use some help in creating a database schema for my program, which manages and installs programs for my home network. Are there any guidelines/tutorials for creating database schemas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

微凉徒眸意 2024-08-10 09:42:27

在设计模式之前,可能需要理解的最重要的概念(稍后您会感谢自己,相信我!:-) 是规范化。 db.grussell.org 上的教程看起来并不算太破烂,会给你一个良好的基础。事实上,如果您单击“上一级”链接并环顾四周,其他一些信息可能也非常有用。

我的“重要提示”是:在开始编写代码之前,将其写在纸上或记事本或数据库以外的任何内容中。在将模式固定下来之前,先充分了解您需要模式能够做什么(我所说的“将其固定”是指,意识到您已经针对模式编写了大量代码,这些代码必须如果您将其更改为执行您刚刚意识到现在需要的操作,则将被重写)。

Probably the most important concept to understand before you design your schema (you'll thank yourself for it later, trust me! :-) is that of Normalisation. The tutorial at db.grussell.org doesn't look too shabby and will give you a good grounding. In fact, if you click the "Up One Level" link and take a look around, some of the other information might be quite useful as well.

My "top tip" is: Write it down on paper or in notepad, or anything other than a database, before you start writing code. Get a good idea of what you need your schema to be able to do before you set it in stone (And by "set it in stone" I mean, realise that you've written a load of code against the schema that would have to be re-written if you change it to do what you've just realised you now need).

兔姬 2024-08-10 09:42:27

设计数据库是一个独立的研究和专业领域。它不能被浓缩为一个答案。由于您对教程感兴趣,请查看任何有关数据库管理系统的教科书中有关数据库设计的部分。我会推荐
数据库系统概念,5e,Abraham Silberschatz,Henry F.Korth,Sudarshan

在数据库设计中,请记住以下内容

1) 您正在识别家庭网络中感兴趣的重要对象。尽量避免过度沉迷于流程本身,尽管它们对于识别您需要捕获的重要数据单元很重要

2) 使用 ER/UML 建模技术来提出数据模型图/设计。有许多案例工具可以帮助您绘制此图。

3) 使用数据库规范化的原则来微调您的架构以避免数据冗余。冗余数据会导致以下副作用: 无法保持冗余数据之间的一致性,无法以优雅的方式存储某些数据

3) 将您的设计正向设计为您选择的数据库的 DDL 语句。大多数案例工具都支持这一点。

案例工具:

  • Microsoft Visio
  • ER Studio(非常昂贵)
  • TOAD data modeller

也有很多开源工具。你可以试试迪亚。这不支持正向工程

Designing Databases is a separate field of study and expertise. It cannot be condensed into one answer. Since you are interested in tutorials, look at the section on Database Design in any text book on Database Management Systems. I would recommend
Database System Concepts, 5e, Abraham Silberschatz, Henry F.Korth, Sudarshan

In database design, remember the following

1) You are identifying the important objects of interest in your home network. Try to avoid excessive indulgence in the processes themselves though they are important to identify the important data units that you need to capture

2) Use ER/UML modelling techniques to come up with a Data Model Diagram/design. There are many case tools that can help you in drawing this.

3) Use the principles of Database Normalization to fine tune your schema to avoid data redundancies. Redundant data leads to the following side effects: Inability to maintain consistency among redundant data, Inability to store some data in an elegant manner

3) Forward engineer your design to DDL statements for the DB of your choice. Most case tools support this.

Case tools:

  • Microsoft Visio
  • ER Studio (very expensive)
  • TOAD data modeller

There are many open source tools too. You can try Dia. This does not support forward engineering

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文