in a relational database, can we have a table without any relation with the other tables?

后端 未结 5 970
忘掉有多难
忘掉有多难 2021-01-13 12:29

in a relational database, can we have a table without any relation with the other tables?

相关标签:
5条回答
  • 2021-01-13 12:56

    Yes. The way relations are expressed are with foreign keys. If a table you generate has no Foreign keys, and no foreign keys in other tables point to this table, it has no relationships.

    It can still be given a relationship later though so don't worry about shooting yourself in the foot.

    0 讨论(0)
  • 2021-01-13 13:02

    Yes you can. Tables do not have to have any relation to each other. Relations can always be added through the use of foreign keys if you want to add them later.

    0 讨论(0)
  • 2021-01-13 13:02

    A database can have multiple relations which they are connected somehow or not. But If you create a relation without adding foreign key into it. I will be created but having no relationship with any other table in the database. You can add relationship as per requirement.

    I am here if you need any other help

    0 讨论(0)
  • 2021-01-13 13:14

    Of course. Even you can create a table without fields.

    0 讨论(0)
  • 2021-01-13 13:15

    I'm creating a company management database and I have a "Company_Expenses" table that I just need for summery reports on the Company's revenues. I can't think of anything this table might need to be connected to so it's just on it's own for now.

    0 讨论(0)
提交回复
热议问题