relational-database

Find related columns among hundreds of tables for future relational identification

旧城冷巷雨未停 提交于 2019-12-11 01:51:48
问题 I am using SQL Server 2016 to pull information out of our ERP system that is stored in a DB2 database. This has thousands of tables with no keys inside of them. When pulling tables from the system, I want to be able to identify matching column names in tables so I can start creating relationships and keys when building dimensions. Is there a way to create a query that will search my database for column names and list every table that uses that column name? I have been using OPENQUERY and

Alternative to database design with enumerated columns, leading to poor performances

风格不统一 提交于 2019-12-11 01:40:52
问题 Following remarks on my previous question, I describe here the problem that led me to have a database schema with enumerated columns, leading to poor performances. (see edit at the bottom of this question for my overall conclusion) I work with gene expression data. We capture in which condition s any gene is expressed (for instance, to say that gene X is expressed in the condition[organ Y - life stage Z]). I have 4 dataType s that can produce such expression data. So my raw data are stored in

Multi Map / Reduce index vs. relational join

落爺英雄遲暮 提交于 2019-12-11 01:39:11
问题 One of the key factors making NoSQL databases more scalable is absense of join operation which is essential part of RDBMS. But at the same time, for example, RavenDb contains Multi Maps / Reduce index feature which looks similar to join. Why do joins limitate scalability but Multi Maps / Reduce indexes do not while they solve pretty similar tasks? 回答1: It depends on when you are actually perform the operation. Join operations are usually executed on the fly, which means that your incur the

Duplicate ForeignKey when using inheritance

痴心易碎 提交于 2019-12-11 01:18:18
问题 I have created these classes in order to generate the database model via EntityFramework 6 code-first approach: public class Vehicle { public long Id { get; set; } public long ResponsiblePersonId { get; set; } } public class Car: Vehicle { public int HorsePower { get; set; } } public class Bike: Vehicle { public int FrameSize { get; set; } } public class Organisation { public Organisation() { Cars = new List<Car>(); Bikes = new List<Bikes>(); } public long Id { get; set; } public List<Car>

Unable to determine a valid ordering for dependent operations?

做~自己de王妃 提交于 2019-12-11 00:23:52
问题 I have this model: public class ContentType { public int ContentTypeId{get;set;} public string Name{get;set;} public Lang Lang{get;set;} public bool IsPublished{get;set;} public int? ParentId { get; set; } public int UserId { get; set; } public virtual User User { get; set; } public virtual ContentType Parent { get; set; } public virtual List<ContentType> Children { get; set; } } It has a one to many relation to itself. And in Context I have this: protected override void OnModelCreating

What Phenomena does MySQL try to prevent by locking the whole table upon executing Delete statement with the condition on a non-indexed column

荒凉一梦 提交于 2019-12-10 23:54:28
问题 Using the MySQL isolation level of Repeatable Read. Given table test having non-indexed column quantity : id | quantity -------------------- 1 | 10 2 | 20 3 | 30 Tx1 executes 1st, note it is not committed yet, meaning that all the acquired locks are not released yet. Tx1: START TRANSACTION; DELETE FROM test WHERE quantity=10; Now executing Tx2 Tx2: START TRANSACTION; INSERT INTO test(quantity) VALUES (40); COMMIT; For Tx2 I get the following result: Lock wait timeout exceeded; try restarting

Yii: How to populate a Select input with another model data?

断了今生、忘了曾经 提交于 2019-12-10 23:54:19
问题 I'm playing around with a small app in order to learn to use Yii. I've created a small webapp with 2 models / tables: Projects and tasks. (1-to-many relationship, properly configured in the model classes). I'm now trying to customize the Task/create view, replacing the text input field with a select box proposing the list of available projects. I opened the form view and tried this: <div class="row"> <?php echo $form->labelEx($model,'project_id'); ?> <?php echo $form->textField($model,

Dynamic queries with hibernate

我只是一个虾纸丫 提交于 2019-12-10 18:27:19
问题 I have an application where i need to enable end users to create adhoc reports by defining their options through some type of wizard whose process would be something like: 1) User selects the table(s) he wants to query (eg person, project, activities) 2) defines the list of fields he requires (eg name, email, projects, activity, activity info) 3) supplies the filter criteria for the records to return (eg Person name, ongoing activities) I am using hibernate with postgres database with more

Lossless Join Property

孤街醉人 提交于 2019-12-10 17:45:24
问题 Can someone please explain to me what is meant by the lossless join property in a relation schema? Is it the ability to maintain the semantics of information/data during the decomposition of relations whilst normalising? 回答1: @Falcon - you are right - but this is a more substantial definition... The lossless join property is a feature of decomposition supported by normalisation. It is the ability to ensure that any instance of the original relation can be identified from corresponding

How to bond N database table with one master-table?

元气小坏坏 提交于 2019-12-10 17:24:45
问题 Lets assume that I have N tables for N Bookstores. I have to keep data about books in separate tables for each bookstore, because each table has different scheme (number and types of columns is different), however there are same set of columns which is common for all Bookstores table; Now I want to create one "MasterTable" with only few columns. | MasterTable | |id. | title| isbn| | 1 | abc | 123 | | MasterToBookstores | |m_id | tb_id | p_id | | 1 | 1 | 2 | | 1 | 2 | 1 | | BookStore_Foo | |p