database

Which Database to choose?

I have the following criteria Database should be protected with a username and password. It should not be possible to copy the database file and use it else were like MS Access. There will be no central database server. Each machine will run their own database server locally and user will initiate synchronization. Concept is inspired f...

Continuation - Viewing FIRST_ROWS before query completes.

I have identified the query constructs my users normally use. Would it make sense for me to create composite indexes to support those constructs and provide FIRST_ROWS capability? If I migrate from SE to IDS, I will lose the ability to write low-level functions with C-ISAM calls, but gain FIRST_ROWS along with other goodies like: SET-RE...

I am not able to create foreign key in mysql Error 150. Please help

i am trying to create a foreign key in my table. But when i executes my query it shows me error 150. Error Code : 1025 Error on create foreign key of '.\vts\#sql-6ec_1' to '.\vts\tblguardian' (errno: 150) (0 ms taken) My Queries are Query to create a foreign Key alter table `vts`.`tblguardian` add constraint `FK_tblguardian` FOREIG...

Hibernate won't save into database

I mapped some classes to some tables with hibernate in Java, i set Hibernate to show SQL, it opens the session, it shows that it does the SQL, it closes the session but there are no modifications to the database. Entity public class Profesor implements Comparable<Profesor> { private int id; private String nume; private String prenume; ...

Best DataMining Database

I am an occasional Python programer who only have worked so far with MYSQL or SQLITE databases. I am the computer person for everything in a small company and I have been started a new project where I think it is about time to try new databases. Sales department makes a CSV dump every week and I need to make a small scripting applicati...

What is the mysql equivalent of Sql Server's @@Identity and @@error and how to use try catch in mysql

I am looking for few global variable in mysql which are equivalent of sql server. I want the whole list eg. Sql Server Equivalent @@error --- @@Identity --- etc. Basically right now I want to know what are the equivalent variable of @@error and @@identity. But it will be helpfull if u could provide some other variable ...

MS Access 2003 - Failure to create MDE file: error VBA is corrupt?

Ok so this is a brand new snag I have run into. I am trying to launch a new MDE from my source MDB file, and it is locking up Access. So in my mdb, I am first compacting and repairing, and then selecting create a new mde (just as I have done many times before). It looks like it is starting the process, but never gets to where it comp...

Good resource for studying Database High Availability techniques

Hello Can anybody suggest some good resource/book on Database high availability techniques? Moreover, High-availability of system software like Intrusion Prevention system or Web servers. I am considering high-availability is global term which covers clustring, cloud computing, replication, replica management, distributed synchronizat...

Advantages of using two tables instead of a column with 2 different values

Hello I'm creating a database structure. I have to store ingoing and outgoing messages and i'm wondering wich is the best way to do this. 2 separated tables or the same tables with an ENUM('in', 'out') column ? Any suggestion ? Thanks. ...

apostrophe in mysql/php

i'm trying to learn php/mysql. inserting data into mysql works fine but inserting those with apostrophe is generating an error. i tried using mysql_real_escape_string, yet this doesn't work. would appreciate any help. <?php include 'config.php'; echo "Connected <br />"; $auth = $_POST['author']; $quo = $_POST['quote']; $author...

Managing Foreign Keys

So I have a database with a few tables. The first table contains the user ID, first name and last name. The second table contains the user ID, interest ID, and interest rating. There is another table that has all of the interest ID's. For every interest ID (even when new ones are added), I need to make sure that each user has an entr...

Mysql - Join matches and non-matches

This is related to my other question: http://stackoverflow.com/questions/2579249/managing-foreign-keys I am trying to join the table of matches and non-matches. So I have a list of interests, a list of users, and a list of user interests. I want the query to return all interests, whether the user has the interest or not (should be nul...

How can I build a voting system to support multiple types of objects to vote on?

I'm really looking for something very similar to the way SO is setup where a few different kinds of things can be voted on (questions AND answers). What kind of DB schema, generally, could I use to support voting on many different kinds of objects? Would I have a single Vote table that would have references to other objects in the datab...

How Implement a system to determine if a milestone has been reached

I have a table named stats player_id team_id match_date goal assist` 1 8 2010-01-01 1 1 1 8 2010-01-01 2 0 1 9 2010-01-01 0 5 ... I would like to know when a player reach a milestone (eg 100 goals, 100 assists, 500 goals...) I would like to know also when a te...

'e-Commerce' scalable database model

I would like to understand database scalability so I've just heard a talk about Habits of Highly Scalable Web Applications http://techportal.ibuildings.com/2010/03/02/habits-of-highly-scalable-web-applications/ On it, the presenter mainly talk about relational database scalability. I also have read something about MapReduce and Column...

Database on the fly with scripting languages

I have a set of .csv files that I want to process. It would be far easier to process it with SQL queries. I wonder if there is some way to load a .csv file and use SQL language to look into it with a scripting language like python or ruby. Loading it with something similar to ActiveRecord would be awesome. The problem is that I don't w...

Statically Compiled Oracle Client Drivers/Code

Hello, I'm looking to write a command-line program that can execute database scripts against an Oracle server, however the machine the program will be run on may not have an Oracle client installed on it. I also don't want to rely on a language that requires a VM as there's no guarantee that the VM will be installed, so a language like...

validation in php

i have a submit page in html. when i submit the form data, it goes to a php page, which inserts the data in the database. my question is how would i ensure that the data on the html page is not null or empty without using javascript? is there anyway this could be done in php? thanks! ...

SQL Average Data Based on Distance

I'm pretty new to SQL. I have a database with records based on road/milepoints. My goal is to get an average value every 52.8 ft along the road. My related table has data every 15 ft, this table of course has a foreign key relating it to the primary table. If I wanted to pull out the average value every 52.8 ft, along a given milepost, ...

Transaction Isolation on select, insert, delete

What could possibly go wrong with the following transaction if executed by concurrent users in the default isolation level of READ COMMITTED? BEGIN TRANSACTION SELECT * FROM t WHERE pid = 10 and r between 40 and 60 -- ... this returns tid = 1, 3, 5 -- ... process returned data ... DELETE FROM t WHERE tid in (1, 3, 5) INSERT INTO t (tid...