rdbms

What are the different types of keys in RDBMS?

若如初见. 提交于 2019-12-18 10:02:30
问题 What are the different types of keys in RDBMS? Please include examples with your answer. 回答1: From here and here: (after i googled your title) Alternate key - An alternate key is any candidate key which is not selected to be the primary key Candidate key - A candidate key is a field or combination of fields that can act as a primary key field for that table to uniquely identify each record in that table. Compound key - compound key (also called a composite key or concatenated key) is a key

What are the different types of keys in RDBMS?

浪尽此生 提交于 2019-12-18 10:02:08
问题 What are the different types of keys in RDBMS? Please include examples with your answer. 回答1: From here and here: (after i googled your title) Alternate key - An alternate key is any candidate key which is not selected to be the primary key Candidate key - A candidate key is a field or combination of fields that can act as a primary key field for that table to uniquely identify each record in that table. Compound key - compound key (also called a composite key or concatenated key) is a key

Many-to-many relations in RDBMS databases

百般思念 提交于 2019-12-18 05:07:09
问题 What is the best way of handling many-to-many relations in a RDBMS database like mySQL? Have tried using a pivot table to keep track of the relationships, but it leads to either one of the following: Normalization gets left behind Columns that is empty or null What approach have you taken in order to support many-to-many relationships? 回答1: Keep track of a many-to-many relationship in a table specifically for that relationship (sometimes called a junction table ). This table models the

Create an inline SQL table on the fly (for an excluding left join)

本小妞迷上赌 提交于 2019-12-17 22:36:44
问题 Let's assume the following: Table A id | value ---------- 1 | red 2 | orange 5 | yellow 10 | green 11 | blue 12 | indigo 20 | violet I have a list of id's (10, 11, 12, 13, 14) that can be used to look up id's in this table. This list of id's is generated in my frontend. Using purely SQL, I need to select the id's from this list (10, 11, 12, 13, 14) that do not have entries in Table A (joining on the 'id' column). The result should be the resultset of id's 13 and 14. How can I accomplish this

When to replace RDBMS/ORM with NoSQL [closed]

送分小仙女□ 提交于 2019-12-17 22:32:22
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What kind of projects benefit from using a NoSQL database instead of rdbms wrapped by an ORM? Examples: Stackoverflow similiar sites?

Transaction support in MongoDB

可紊 提交于 2019-12-17 19:18:17
问题 I am new to MongoDB. I read that MongoDB does not support multi-document transactions here http://docs.mongodb.org/manual/faq/fundamentals/. If I want to save data in two collections(A and B) atomically, then i can't do that using MongoDB i.e. if save fails in case of B, still A will have the data. Isn't it a big disadvantage? Still, people are using MongoDB rather than RDBMS. Why? 回答1: MongoDB does not support multi-document transactions. However, MongoDB does provide atomic operations on a

Best representation of an ordered list in a database?

荒凉一梦 提交于 2019-12-17 15:37:10
问题 I know that this sort of goes against the principles of a relational database but let me describe the situation. I have a page where the user will place a number of items. ________________ | -Item1 | | -Item2 | | -Item3 | | -Item4 | |________________| These items have must stay in a the order the user gives them. However this order may be changed an arbitrary number of times by the user. ________________ | -Item1 | | -Item4 | | -Item2 | | -Item3 | |________________| Approach 1 My original

Should I normalize my DB or not?

浪子不回头ぞ 提交于 2019-12-17 15:25:43
问题 When designing a schema for a DB (e.g. MySQL) the question arises whether or not to completely normalize the tables. On one hand joins (and foreign key constraints, etc.) are very slow, and on the other hand you get redundant data and the potential for inconsistency. Is "optimize last" the correct approach here? i.e. create a by-the-book normalized DB and then see what can be denormalized to achieve the optimal speed gain. My fear, regarding this approach, is that I will settle on a DB design

What is the difference between DBMS and RDBMS?

一曲冷凌霜 提交于 2019-12-17 15:21:59
问题 After reading some answers on different websites I am confused now. So, it would be helpful to mention the key difference between DBMS and RDBMS and any relation between them. 回答1: Since this question become popular on Stack Overflow, I am posting an answer which answers this question for me. I found this answer on udemy website. Hope this will help future users and newbies searching for a good answer on this topic. Key Difference between DBMS and RDBMS: The key difference is that RDBMS

Drop all tables command

天大地大妈咪最大 提交于 2019-12-17 06:28:30
问题 What is the command to drop all tables in SQLite? Similarly I'd like to drop all indexes. 回答1: I don't think you can drop all tables in one hit but you can do the following to get the commands: select 'drop table ' || name || ';' from sqlite_master where type = 'table'; The output of this is a script that will drop the tables for you. For indexes, just replace table with index. You can use other clauses in the where section to limit which tables or indexes are selected (such as " and name