database

C# Where to place code that retrieves GUI data?

I'm puzzling with where to place some code. I have a listbox and the listitems are stored in the database. The thing is, where should I place the code that retrieves the data from the database? I do already have a database class with a method ExecuteSelectQuery(). Shall I create Utility class with a method public DataTable GetGroupData()...

Has anyone published a detailed comparison between different in-memory RDBMSs?

There are quite a few independent and not-so-independent studies comparing traditional RDBMSs but I haven't managed to find any good material on in-memory databases. I am primarily interested in ones specialized for OLTP. So far, I managed to find generic white papers on TimesTen and MySQL Cluster, but I have yet to see a head-to-head c...

Postgres and Indexes on Foreign Keys and Primary Keys

Does Postgres automatically put indexes on Foreign Keys and Primary Keys? How can I tell? Is there a command that will return all indexes on a table? ...

Is it possible to hack database server that open only 3 ports?

From my last question, I have new idea for database protection. The following ports will be connected via SSL only. Is it possible to hack this database server? Http Port for sending & receiving data via WCF Services or Web Services. Ftp Port for updating above services. PS. This question is not include SQL injection problem. Thank...

how to insert,delete and update data in database using ado.net in Vb.net (database MS access)?

Imports System.Data Imports System.IO Imports personal_dtls.perds Imports personal_dtls.perdsTableAdapters Private Sub insert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles insert.Click Dim adapter As New perdsTableAdapters.Daily_AttndTableAdapter adapter.InsertQuery("as", "asd", "...

MySql Foreign Key index

Hi, I am using a Mysql table products which has a foreign key category_id on the categories table the foreign key constraint is defined (Innodb engine). I noticed that when I run EXPLAIN SELECT * from products where category_id=1; it uses the foreign key, so I see type=Range and Key: my_foreign_key But when I run EXPLAIN SELECT * f...

Techniques for sorting up/down voted items

I'm pulling items from a database (in this case, comments, but it should apply to anything) and have the following information about them: The number of up votes The number of down votes (consequently, the total score and number of votes) The date the item was created I'm interested in coming up with a way to sort them with the followin...

C++ SQL database library comparison

Hi, I am starting development on a medium-scale C++ project that has to work with a Microsoft SQL Server database. I have done database work before using .NET technologies but I don't find using a .NET approach to be appropriate this time. I would like to get some feedback concerning the various free (as in GPL, LGPL, Boost) C/C++ SQL l...

Django conditional aggregation

Does anyone know of how I would, through the django ORM, produce a query that conditionally aggregated related models? Let's say, for example, that you run a site that sells stuff, and you want to know how much each employee has sold in the last seven days. It's simple enough to do this over all sales: q = Employee.objects.filter(type...

What data structure should I use to track dependency?

I have a bunch of tables in a relational database which, obviously, are dependent upon one another due to foreign key relationships. I want to build a dependency tree, traverse it, and output INSERT SQL statements. I need to first output SQL for foreign key tables in my dependency tree first because parent tables will depend on values fr...

SQL how to increase or decrease one for a int column in one command

I have an Orders table which has a Quantity column. During check in or check out, we need to update that Quantity column by one. Is there a way to do this in one action or we have to get the existing value and then add or minus one on top of it? Another question is when we insert a new row, do we need to check if same data existing then...

Transfering data from one database to another

I have two databases, lets say Database A and B, with different datastructures. In Database A there is a table contacts. In Database B there is a table Accounts. I want to transfer data from Database A table contacts to Database B table Accounts. I am use SQL Server 2005 and want to write sql scripts to do this. Can someone tell me wh...

Dynamic Table Creation and ORM mapping in SqlAlchemy

I'm fairly new to using relational databases, so I prefer using a good ORM to simplify things. I spent time evaluating differing Python SQL libraries and I think SQLAlchemy is what I need. However, I've come to a mental dead end. I need to create a new table to go along with each instance of a player I create in my app's player table....

cross query Question - (sum & avg)

Hi is it possible with cross query to do this ? (in Access 2007) I have this table: 50 | A1 60 | A1 70 | B1 80 | B1 90 | C1 I need to get this result: A1 ------------------ B1 --------------- C1 sum | avg ----- sum | avg ----- sum | avg 55 | 110 --------- 75 | 130 ...

How to catch CONSTRAINT Exception when adding duplicate unique id with VB

I have a problem that adding a new ROW with duplicate UNIQUE id throws CONSTRAINTException that I cannot always catch.. Randomly general exception halts my VB software, sometimes catching works. here is my code. Private Sub BindingNavigatorAddNewItem_MouseUp() try DataGridView1.CurrentRow.Cells(0).Value = InputBox("give new ...

What is transaction?

Well could someone provide a really simple (but not simpler than possible) explanation of transaction as applied to computing (even if copied from Wikipedia)? ...

JSON save in Database and load with JQuery

I create a huge JSON-Object and save it in my database. But when I load the "string" and echo it in PHP, I can't access the JSON Object in JQuery. Do I have to consider something if I want to save my JSON Object in a MySQL Database (when I just create the Array and then echo it with "echo json_encode($arr);" it works fine, but I need to ...

How can I iterate through a list of rows returned from a select statement in SQL?

Given a SQL statement: select id from myTable where id = -1 How do I iterate through each of the results? I want to perform a specific operation for each result e.g (in pseudocode): foreach (result from my statment) { delete all rows from myOtherTable that has a value of result; } How would I write a SQL statement to do this? N....

What are some of your most useful database standards?

I have some ideas, but I really want to know what makes things go smoothly for you when modeling database: Table name matches Primary Key name and description key Schemas are by functional area Avoid composite primary keys where possible (use unique constraints) Camel Case table names and field names Do not prefix tables with tbl_, or...

Java EJB entity beans performance

How performant is the entity bean? Would it be too much to ask if I want 1000 objects per table (probably about 20 tables) across 5 processes where some processes might be changing the objects as often as 60 times a second? Are there any resources out there on the limitations of the entity bean? Thanks for any help! ...