rdbms

When to use ternary relationship instead of aggregation in RDBMS?

不羁岁月 提交于 2020-07-06 20:19:49
问题 I was wondering when one would represent a relationship between an entity set and a relationship with a ternary relationship? I understand the benefit of aggregation, but why use it if there is no attribute in the relationship between the entity set and the relationship set? For instance, a grad student (with a student # and name) works on a project (with pid, start date, and end date) and each project that a student works on has a supervising professor. Every project must have only one

Best way to design a table with m:n relation

独自空忆成欢 提交于 2020-01-25 11:54:04
问题 What is the best way to design a table for a m:n relation between two entities?? 回答1: Three tables. One defining the first entity, one defining the second, and a third representing the relationship between them. Table 1 (first entity): T1Id, T1Name Table 2 (second entity): T2Id, T2Name Table 3 (relationship): T1Id, T2Id 来源: https://stackoverflow.com/questions/29400091/best-way-to-design-a-table-with-mn-relation

Choosing between a directory server (a.k.a LDAP database) and an RDBMS

烂漫一生 提交于 2020-01-23 06:55:48
问题 In my project, where I'm the lead developer, we earlier had a network configuration that was stored a single XML file. The configuration contains info about a network layout - its constituent hosts, various details about each host like OS, platform, users configured in each them, several attributes for each user and so on. In the forthcoming version of the product, we want to move the data into a database of some sort since the configuration will be expanded to include more elements and

What's the correct name for an “association table” (a many-to-many relationship) [closed]

北城以北 提交于 2020-01-19 22:24:17
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . What's the correct or most popular name for an "association table"? I've heard lookup, associative, resolving, mapping and junction table. 回答1: Cross reference table. CustomerProductXRef. 回答2: There is no "correct" name, but the academic name would be an "Associative Table"

What's the correct name for an “association table” (a many-to-many relationship) [closed]

℡╲_俬逩灬. 提交于 2020-01-19 22:23:20
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . What's the correct or most popular name for an "association table"? I've heard lookup, associative, resolving, mapping and junction table. 回答1: Cross reference table. CustomerProductXRef. 回答2: There is no "correct" name, but the academic name would be an "Associative Table"

How can I optimize a query that returns a lot of records, then order by a date field and return only the latest one? [duplicate]

别说谁变了你拦得住时间么 提交于 2020-01-17 22:39:24
问题 This question already has answers here : Optimizing a query returning a lot of records, a way to avoid hundreds of join. Is it a smart solution? (3 answers) Closed 2 years ago . I am not so into database and I have the following doubt about the possible optimization of this query (defined on a MySql database): SELECT MCPS.id AS series_id, MD_CD.market_details_id AS market_id, MD_CD.commodity_details_id AS commodity_id, MD.market_name AS market_name, MCPS.price_date AS price_date, MCPS.avg

Can an attribute designate one table over another?

廉价感情. 提交于 2020-01-15 09:51:28
问题 I'm creating a sports statistics database. With it, I'd like to catalog game/match statistics for many types of sports. For example, this database would be able to tell you how many touchdowns the Carolina Panthers scored in the 09-10 season (football), or how many free throws were made by the Miami Heat in their last game (basketball). I'm having trouble designing one of the more fundamental tables called Matches. The Matches table has columns for: ID (PK match_id ) date of play ( play_date

Trigger selection from same table

笑着哭i 提交于 2020-01-15 08:08:47
问题 I would like to ask a question about triggers. Let's say that I have a table T and I need a trigger before update. However, I have a problem. I need to check a condition using the other rows of T from the trigger. My question is: Which RDBMS's support this? Where can I write triggers which perform selection(s) on the same table where the trigger fires. For instance: CREATE TRIGGER updtrigger BEFORE UPDATE ON Employee -> FOR EACH ROW -> BEGIN -> IF NEW.Salary<=500 THEN -> SET NEW.Salary=10000;

Getting wrong values for other columns when I select MAX(updated_date)

懵懂的女人 提交于 2020-01-14 14:41:32
问题 I am using select field1, max(updated_date) from mytable . I get the correct value for max(updated_date) , i.e. the largest date. However for field1 I just get the the value for the first record, i.e. "ta1" when I really want the "ta3" value from the third record (the one with the max date value). e.g. +------------+---------------------+ | field1 | update_date | +------------+---------------------+ | ta1 | 2012-03-11 11:05:15 | | ta2 | 2012-03-11 11:05:32 | | ta3 | 2012-03-11 11:05:56 | +---

What privileges are needed to create\delete tables on a Microsoft SQL Server? Is dbowner ok?

倾然丶 夕夏残阳落幕 提交于 2020-01-14 04:00:08
问题 I am not so into SQL Server and I have the following doubt: I have to require the creation of an user that can work on some databases. This user have to create\delete table, insert\delete records in these tables. What type of permission have to be set for this user on these databases? Is dbowner ok to perform these operations? (in particular is very important that this user can create\delete tables) or am I missing something? 回答1: Just to understand first the benefits of using roles : Roles