database

MySQL: How to find all IDs of children recursively?

I would like to get all IDs from children in a tree with MySQL only. I have a table like this: ID parent_id name 1 0 cat1 2 1 subcat1 3 2 sub-subcat1 4 2 sub-subcat2 5 0 cat2 Now I'm trying to get all child IDs for cat1 (2,3,4) recursively. Is there any way how to achieve that? Thanks for...

linq to sql , model first development ?

Hi, Is is it possible to use l2s in model first approach? Here's the think i want to achieve: I want to write my app in TDD manner, so I want to write some domain specific objects first and then base on that generate database model. One solution is to l2s as DAL but and map linq generated entities to my custom domain objects(I Rob C. in...

Should the descriptive tags associated with an entity be stored in a separate database table?

I have a Questions model, and just like StackOverflow, each question can be tagged with multiple descriptive tags by a user. What I'm trying to decide is whether it's necessary for the Tags associated with a question to be stored in a separate table in the database. Or could I store the Tags as a single field of the Questions table as...

Migrating from MS SQL to MySQL: SQLOLEDB? Migration kit login error?

I've been put in charge of migrating a customer's website of MS SQL/ASP to PHP/MYSQL. I have zero experience with MS SQL. I'm trying to figure out the best way to get the current data migrated to MySQL so I can begin PHP development. Some details: I downloaded SQL Server Mangement Studio Express. I found the following string in...

Include a database file with Android application via Eclipse

How can I instruct Eclipse to copy a file from my Android solution to an emulator, as part of Run/Debug? I have a small database, stored in Assets, that needs to accompany the application. Thus far I have simply copied the file myself using DDMS but would prefer to have it automatically included. The project properties allow me to specif...

Checking passwords against word database on server or use a web service?

If I want to check passwords in my application for the inclusion of English words, should I store a database of English words locally (is there a free database?) or is there a (free) web service I can use to check them remotely? Ideally I would check the words using an Ajax call but I don't want to pass the entire English dictionary by...

database transactions and threads

I have functions lock(), unlock(), query1(), query2() and query3(). The query functions just run some query on a database and can be considered r/w access to it. They do not lock. My system is multithreaded. The functionality I want is: If lock() is called from thread p1, only queries from thread p1 will run and queries from all other t...

What is a better way to store status updates in a database?

I'm developing a web application that will enable users to post short status updates similar to Twitter. The only way I can think of storing these posts is to have a large "status_updates" table that stores EVERY user's status updates: -------------------------------------- | table: status_updates | ------------------------...

How would you represent a relational entity as a single unit of retrievable data in BerkeleyDB?

BerkeleyDB is the database equivalent of a Ruby hashtable or a Python dictionary except that you can store multiple values for a single key. My question is: If you wanted to store a complex datatype in a storage structure like this, how could you go about it? In a normal relational table, if you want to represent a Person, you create ...

django db writes not happening immediately when running in admin site

I have a snippet of code like this in a Django application def update_account(user_account,add_widget_count): user_account.add_widgets(add_widget_count) user_account.save() notify_other_system_about_account_update(user_account) When I run this as part of my application, everything works great. In particular, when my other...

Django admin: turning off DB transactions

I noticed that by default, all updates in the django admin site are done as transactions. I need to either: - turn off transactions (globally or for a particular admin view) - inside of a save() method of an entity being saved via the admin interface, commit the transaction The reason is that I overrode the save() method, and am noti...

What is sharding and why is it important?

I think I understand sharding to be putting back your sliced up data (the shards) into an easy to deal with aggregate that makes sense in the context. Is this correct? Update: I guess I am struggling here. In my opinion the application tier should have no business determining where data should be stored. At best it should be shard c...

Executing Multiple Insert Statements, what's the Best Way?

I have a program in which I need to run multiple insert statements (dynamically generated) against a MS SQL Table. Right now, I do (pseudo-code): Loop Generate Insert Statement String SQLCommand.Text = Generated Insert Statement String SQLCommand.Execute(). End Loop Close Connection Is it better performance-wise to simply construct o...

What are the strengths and weaknesses of a triplestore database?

What are the strengths and weaknesses of a triplestore database, such as Mulgara? In which situations would its performance be significantly different from that of a traditional relational database? I'm thinking in particular about situations where you have data in the form namespace:predicate=value. Triplestores would seem to keep the ...

Database consistency checking framework

I'm looking for a framework to utilize to integrate a number of database consistency checking rules into our system. This should basically be a automated test case runner for our database checks. Requirements: Easy to write new rules or checks Easy to run all rules, grouping of rule subsets would be a bonus Accurate and simple reporti...

One big table or separate tables to store product reviews of part types?

I need to make 100 or so tables. I have tables called PartStatsXXX and the tables to be made will all be called PartReviewXXX (they pair up with each other in a 1:n relationship). Is it efficient to create one big table to store all product (product and part being the same term from a business perspective) reviews? Someone mentioned mak...

Relational Database

Can you do more than one clause in SQL without using aggregation and only: selection, join? Thanks. ...

Using Visual C++ Express to connect To Access 2000

I have used the Borland IDE to connect to Access Databases for a while now but Borland got bought and the upgrade is more than I can afford so I am trying to switch to Visual C++ Express. I can get the explore data to show my databases how do I get from there to being able to read the records and work with them? Which controls do I nee...

Best way to update in a db a list of mails

I have the following db schema. SQL> describe USERS; Name Null? Type ----------------------------------------- -------- ---------------------------- user_id NOT NULL NUMBER(38) name NOT NULL VARCHAR2(50) password ...

How to pass parameters to ms access to get the data back

Hi I am new to ms access..Can anybody help me in sending parameters to queries and get back the data(with an example)..i am using C# as coding language(Asp.Net) Thanks in advance ...