database

How to handle non-normalised data

I'm building an database to manage paying some of our freelance sellers. They get a daily rate, commission per product, and other expenses (such as mileage for example). Some of the items and expenses have standard rates. For example, £20 for selling a certain type of item. The will of course change over time. So, for example, this year...

How do you handle testing applications that are heavily dependent on databases?

Hi there. At work we've found our test suite has got to the point that's it too slow to run repeatedly, which I really don't like. It's at least 5 minutes over the entire suite, and over 3 minutes for just the back-end data object tests. So, I'm curious to hear how people do their testing. At the moment, we have a single database serve...

problem sybase autogenerated ids

Hi , I have a table in which the PK column Id of type bigint and it is populated automatically increasing order of 1,2,3...so on i notice that some times all of a sudden the ids that are generated are having very big value . for example the ids are like 1,2,3,4,5,500000000000001,500000000000002 there is a huge jump after 5...ids 6 , 7 w...

If a data model changes (an object) whats the best approach to also update the database ?

Let's say theres a Teacher object and that Teachers holds a list of Courses objects. The courses for the Teacher can change. Some get added, some get deleted. What's the best approach to update this changes in the database. 1. Right after every change, update the database. e.g.: A course get added, immediately add that into the database ...

different databases for handling sessions...am I doing the right thing?

I'm looking for some advice on whether or not I should use a separate database to handle my sessions. We are writing a web app for multiple users to login and check/update their account specific information. We didn't want to use the file storage method on the webserver for storing session information, so we decided to use a database...

Incremental development with subsonic

I'm in the process of starting up a web site project. My plan is to roll out the site in a somewhat rudimentary form first and then add to the site functionality along the way. I'm using Subsonic 3 for my DAL, and I'm expecting the database will go through multiple versions as the sites evolve. This means I'll need some kind of versioni...

Is it a good idea to use CodeIgniters Active Record library to manipulate MySQL databases or should I just use SQL?

I'm starting to get to grips with CodeIgniter and came across it's support for the Active Record pattern. I like the fact that it generates the SQL code for you so essentially you can retrieve, update and insert data in to a database without tying your application to a specific database engine. It makes simple queries very simple but ...

MYSQL Contraints - Multiple Checks

Well i am here writing some constraints for a db I am working on and i was wondering if I could do the following: ALTER TABLE Course ADD CONSTRAINT cs_level CHECK (clevel in ('P','I','II','III')) ...instead of this: ALTER TABLE Course ADD CONSTRAINT cs_level CHECK (clevel = 'P' OR clevel = 'I' OR clevel = 'II' OR clevel = 'III') ...

JDBC SQL Server Database Migrations

I'm working on a Java web application (Adobe Flex front-end, JPA/Hibernate/BlazeDS/Spring MVC backend) and will soon reach the point where I can no longer wipe the database and regenerate it. What's the best approach for handling changes to the DB schema? The production and test databases are SQL Server 2005, dev's use MySQL, and unit t...

How to connect to a database in ASP.NET?

I moved to ASP.NET from PHP where the queries are run directly. So I always create Connection in the Page_Load Event, dispose it after I do all stuff needed, and access data with NpgsqlCommand. (Yes, I use Postgresql in my ASP.NET applications.) After starting to learn ASP.NET MVC I was amazed how easy it is to access SQL with the LINQ ...

How to quote values using group_concat

I need to use group_concat to build a list of comma separated values but I need the values to be quoted. How do I do this? This: 425,254,431,53,513,13,1,13 Should be converted to: '425','254','431','53','513','13','1','13' ...

Suppose I have 400 rows of people's names in a database. What's the best way to do a search for their names?

They will also search part of their name. Not only words with spaces. If they type "Matt", I expect to retrieve "Matthew" too. ...

Could the database requirements of this web app be offloaded to saas database solution

For a contact management system web app that allows tennants to upload lists of contact records (having varying field structures) and then displays these back to multiple users (within tennant) one at a time is there a good p/saas database solution to handle this -it would need to allow uploading lists with custom fields (20K records per...

Parse error in PHP login form

I'm trying to have a login form in php. But my current code doesnt work. Here is the form: <form name="form1" method="post" action="loginverify.php"> <td><font size="3">Username:</td> <td></td> <td><input type="text" name="uname" value="" maxlength="15"/><br/></td> <td><font size="3">Password:</td> <td></td> <td><input type="text" name...

When to switch from Spreadsheet to RDBMS?

I've volunteered with a Non-Governmental Organization to help with their record-keeping at their community centre. At present, there is only one community centre where all their data is stored. However, this is expected to change by the end of the year. Presently their data is maintained using a workbook with two sheets. Each record in ...

Establishing persistent connection to a database in Java

I've ran through several examples over the web, and found that every single time I need something from the DB, I should write the following code: try { // Step 1: Load the JDBC driver. Class.forName("mysql_driver_name"); // Step 2: Establish the connection to the database. String url = "jdbc:string_to_mysql_server"; Connec...

What strategy to migrate data from a spreadsheet to an RDBMS?

This is linked to my other question when to move from a spreadsheet to RDBMS Having decided to move to an RDBMS from an excel book, here is what I propose to do. The existing data is loosely structured across two sheets in a work-book. The first sheet contains main record. The second sheet allows additional data. My target DBMS is my...

Prevent read when updating the table

In MySQL: Every one minute I empty the table and fill it with a new data. Now I want that users should not read data during the fill process, before or after is ok. How do I achieve this? Is transaction the way? ...

Today's best approaches on scalable high-performance PHP-applications

Hi everybody! We are in the startup build phase of a new PHP webapp that will be placed onto a cloud server to allow fast and easy up/downscaling when customers will grow or decrease in numbers. Most probably, we will use a PHP framework (Codeigniter) to keep development speed high. Our next step is to implement features for increased ...

Searching for a website about creating databases

What websites do you know about developing DB? It should have a lot of examples(e.g. file-store architecture, meta-data db, data-warehouse). ...