rdbms

How to extract database name from connection string irrespective of RDBMS?

拟墨画扇 提交于 2019-12-06 15:40:28
I am working on the class which is not aware about the RDBMS being used. Of-course, rest of the application is well aware about it. Connection string is input to this class. I need database name. How can I extract database name from connection string irrespective of RDBMS? I read following question: How to get Database Name from Connection String using SqlConnectionStringBuilder Extract properties of sql connection string Following approaches are suggested there: Use Connection String Builder class: Most answers use connection string builder with specific RDBMS. So, I have to use either

Migrate RDBMS to Cassandra

北战南征 提交于 2019-12-06 14:53:37
I have a RDBMS database with the following tables: Airport ( iata PK , airport, city, state, country, lat, long) cancellation_cause ( cod_cancellation PK , description) Manufaturer (id_manufacturer PK , manufacturer_name) Model (id_model PK , model_name, id_manufacturer FK ) Airline ( airline_code PK , description) airplane_type (id_AirplaneType PK , airplane_type) engine_type (id_engine PK , engine_type) Aircraft_type (id_aircraft PK , aircraft_type) Airplane (TailNumber PK , id_model FK, id_aircraft FK , airline_code FK , id_AirplaneType FK , id_engine FK, Issue_date, status, year) Flight

Best practices for mixed usage of RDBMS and files on filesystem

橙三吉。 提交于 2019-12-06 14:48:28
In one of the tables in the schema I am working on, I need to deal with couple-of thousand "data-sheets" which are mostly PDF documents, and sometimes graphic-image files like PNG, JPG etc. The schema models a Electronics Distributor's portal, where new products get added to their portfolio frequently. These documents (data-sheets) are added, at the time of introduction of a new product, but they need updates from time to time (s.a. due to newer version of the document, not the product itself), so I'd think the update to be an asynchronous procedure. Given this, should I keep only the file

Only one key from composite primary key as foreign key

倾然丶 夕夏残阳落幕 提交于 2019-12-06 14:35:29
问题 In this database, key1 & key2 make up the composite primary key of table4 , but i'm able to add a foreign key to table3 that comprise just key1 . Why MySQL allows this? Does the above database design make no sense at all? 回答1: TL;DR It's not standard SQL. MySQL documentation itself advises not doing it. In SQL a FOREIGN KEY declaration must reference a column list declared PRIMARY KEY or UNIQUE NOT NULL. (PRIMARY KEY creates a UNIQUE NOT NULL constraint.) (The constraint has to be explicit,

How to model this multiple inheritance relationship with a RDBMS?

亡梦爱人 提交于 2019-12-06 13:45:54
I'm looking at this data model I've come up with and not feeling comfortable. I've changed the entity names so it (hopefully) makes more sense. In any event, how would you model the following? I have 3 entities. GovernmentCustomer, PrivateCustomer, PublicCustomer. Private and Public Customer are both CorporateCustomers. Corporate and Government Customers are Accounts. All Accounts share the same key space (So if PrivateCustomer has a PK of 1 it shouldn't be possible for Public or GovernmentCustomer to have a PK of 1). CorporateCustomers have some 1:M relationships that GovernmentCustomer's don

SQL Server 2005 - Trigger Loop?

匆匆过客 提交于 2019-12-06 12:37:02
I am using triggers for the first time. If I update a field in a table by an update trigger on the same table, with this spark a loop? Does sql server guard against this recursive behavior? Thanks This page (search for RECURSIVE_TRIGGERS ) describes some of the database settings you can use to modify this behavior. Also, one way to safeguard your procedures is to use either the UPDATE() function or the COLUMNS_UPDATED() function. If, for example, you have a table with columns A , B , and C , and you want the value of C to change automagically when the value in column B is updated, you can

Can I set up a filtered, star-pattern database replication?

血红的双手。 提交于 2019-12-06 12:35:40
问题 We have a client that needs to set up N local databases, each one containing one site's data, and then have a master corporate database containing the union of all N databases. Changes in an individual site database need to be propagated to the master database, and changes in the master database need to be propagated to the appropriate individual site database. We've been using MySQL replication for a client that needs two databases that are kept simultaneously up to date. That's a

which diagram to use in NoSql (Mcd, Merise, UML)

风流意气都作罢 提交于 2019-12-06 10:51:59
again, sorry for my silly question, but it seems that what i've learned from Relation Database should be "erased", there is no joins, so how the hell will i draw use Merise and UML in NoSql? http://en.wikipedia.org/wiki/Class_diagram this one will not work for NoSql? How you organize your project is an independent notion of the technology used for persistence; In particular; UML or ERD or any such tool doesn't particularly apply to relational databases any more than it does to document databases. The idea that NoSQL has "No Joins" is both silly and unhelpful. It's totally correct that (most)

Revisions: algorithm and data structure

不打扰是莪最后的温柔 提交于 2019-12-06 10:00:45
I need ideas for structuring and processing data with revisions. For example, I have a database of objects (e.g. cars). Each object has a number of properties, which can be arbitrary, so there's no a set schema to describe these objects. These objects are probably saved as key-value pairs. Now I need to change property of an object. I don't want to completely rewrite it - I want to be able to go back and see history of changes to these properties, that's why I want to add new property and keep the old one (so I guess a timestamp would do the job of telling which property is the latest). At the

inventory system: transaction-based or store quantity, update with trigger?

时光怂恿深爱的人放手 提交于 2019-12-06 09:37:32
How would you design the data model for an inventory management system in RDBMS? Would you: store each purchase & usage, and uses SUM() and GROUP BY to calculate the warehouse quantity on-the-fly? same as 1, but consolidate the quantity daily, and use the value of the previous day? quantity as an Int field, update through application layer? same as 3, but make use of DB trigger? Transaction-based inventory system seems to be superior in terms of level of details it captures, but it is harder to implement it correctly. Performance will degrade over time. Quantity-based inventory system seems