Tag Info

New answers tagged

0

In a nutshell: Your diagram would be more complete if it showed the data types -- and a relational DB design must have data types specified -- but as a brief summary, it is OK to omit types for brevity, especially if your field names are descriptive enough. Strictly speaking, the relational DB model includes the table and the column where a table is a tuple ...


0

Read a plain language description of your data. A Product is a noun. A noun can become an entity and an entity becomes a table (or several tables). The words buy and sell are verbs, actions that take place with entities. Verbs do not become tables. A suggestion was to have a transaction table. Fine, "transaction" is a noun and the actions buy and sell would ...


3

As you have multiple rows inside the JSON column, you need a function that returns a set. This can be done using the json_to_recordset() function: select j.* from json_test, json_to_recordset(json_data) as j(name text, country text, hobby text, address text, sex text); Because this is an anonymous record type, you must explicitly define each column. ...


2

I am quite sure that the term you are looking for is derived relation. In relational jargon, a single and normalized table is called a base relation (or base table). It can be said that this category of relations are the “concrete” tables that are stored in a RDBMS. The fact of applying relational operations (such as JOIN, for instance) on these base ...


0

Yes, it's atomic; your domain is the ISBN. If you were storing the domains for ISBNPrefix, ISBNRegistrationGroup, ISBNRegistrant, ISBNPublication and ISBNCheckDigit, then you'd split it up. Consider the North American phone number +1-234-567-8901 ext 234567. Many systems choose to store such a number under two domains, such as PhoneNumber and ...


2

Although Cassandra allows the definition of "columns" within a "table", these are much less strict than a relational database schema. As it says here different rows in the same column family do not have to share the same set of columns, and a column may be added to one or multiple rows at any time. In this world, the new value is only added to the ...


0

First, it's hard to ascertain what you need as I don't know what your data means. What is ShareID and what are the groups for? How do ItemIDs relate to ShareID? Is the data one-to-one or one-to-many? etc... With that said, I do know for sure that Option 1 does not follow good practice. You don't store different types of data in the same columns. You have ...


1

Q1. Is storing computed bitorderstring are good way or maybe let user wait a little? =) (I guess, result set will be much more than I tested) MySQL supports columns of type bit. These only use one bit each, in sets of 8, as you would expect. This will give the same disk and memory density as you're currently getting, but with much easier query ...


1

WHERE (1 << CVbits) & ConcVal AND CVbits != 0 -- (to "exclude the zero bit")


2

I've heard the term "flattened" view of the data...meaning the hierarchy of the relationships have been removed.


0

You are being asked to engage in reverse engineering. Reverse engineering is often done in the case of legacy systems, in order to find out what goals the original designers might have been pursuing. It's really an iffy proposition, nevertheless. You best handle is the foreign key constraints. These reveal the FDs, presumably. Also, you can presume that ...


2

I guess the term you are looking for is universal relation although mostly the term is used as a hypothetical relation that is the basis of normalization rather than a view-representation of normalized tables made afterwards. From Fundamentals of Database Systems (Elmasri & Navathe), 6th ed. p. 544: Section 16.3 is devoted to the development of ...


1

Martin, If I am understanding correctly, the employee can be associated with one or more tasks, phases, and projects. This implies a many to many relationship between an employee and a task, phase, or project. If this is the case, throw out the idea of the assignment table completely. Instead, create three different junction tables that can be used to ...


0

The easiest way is to create a multiple field index for your bookings table. The table should have at least the three fields e.g. dtmDate, dtmTime, strRoom. Then in design view ribbon show the table indexes. Create a new index called Bookings. In the adjacent column select dtmDate. The next row down select dtmTime. The next row down select strRoom. Then for ...


0

If you can only have one Parent article, add a column and call it 'parentArticle'. ALTER TABLE table_name ADD parentArticle int This will link to the article id of the parent article. You can then have as many depth as you would like. I would like to be able to shift a set (articles and all sub-articles) under the domain of another article with ...


0

---Method 1 using Ident_Current BEGIN TRAN INSERT INTO places (place_name) VALUES ('XYZ') INSERT INTO trips (trip_name) VALUES ('MyTrip') Insert INTO trips_places_asc (trip_id,place_id) values (Ident_Current('trips'), Ident_Current('places')) COMMIT TRAN ---Method 2 Using Scope_Identity ...



Top 50 recent answers are included