database

How do I run SQL queries on MDB files?

I need to run an UPDATE query on a large MDB file (~30mb), is it possible? how? ...

One-to-one relationship or One-to-many?

Maybe I need more coffee this morning but here goes... I have a very simple inventory system. Right now I have two tables: Items and Inventory. Items Id Title YearReleased Inventory Id ItemId(Foreign key to Items) Quantity QuantityOnHand Each item has one inventory and each inventory belongs to one item. The relationship betwe...

Database-safe Date/Time String?

Which format of a date/time string would be considered cross-platform, cross-database, universal safe? Would this YYYY-MMM-DD HH:MM:SS be considered safe to use in MySQL, SQLite 2 & 3, MsSQL and other common databases? How about something like 2010-Jul-12 12:00:00pm? ...

Do all RDBMS have a Data Dictionary comparable to the one Oracle has?

Is it possible to retrieve information like: the tables the indexes with the columns they index the columns in each table along with their types constraints like unique keys, foreign keys, not null .. using sql from all (major) RDBMSs? I know it is possible for oracle and assume it is possible for most others. Are there any importa...

How can I select the database record with the most vote_points and ensure that it is displayed first? PHP / Kohana 3

Hello everyone and as usual, thank you to anyone taking the time to read this. I am attempting to display all of the answers relevant to a question that has been asked. I am using Kohana 3. So far, I am able to determine which record has the highest amount of vote_points via: $best_id = DB::query(Database::SELECT, 'SELECT id FROM ans...

How do you store sales ?

Hi, How would you store sales ? I though about storing a serialized array which contains the products ordered vs a sale_product table with a foreign key referencing products ordered. What are you thoughts about this ? Any experience with one of these ? Ty ...

Fast single table database.

I have an analytics database where I make complex queries. Each of these queries generates thousands of rows. I want to store these results in some kind of on disk cache so I can get the results later on. I can't insert the results back into the database where the results came from as that database is read only. The requirements of this ...

Merging strategy for access 2007 database

I have a Windows application with access 2007 database which is deployed at 2 different locations - Sales office/Factory. Every day both the locations need to sync up the database so orders are propagated to the factory and order status/invoices/production updates are propagated to the sales office. The schema for both the db copies is i...

Most efficient database design for a blog (posts and comments)

What would be the best way of designing a database to store blog posts and comments? I am currently thinking one table for posts, and another for comments, each with a post ID. It seems to me, however, trawling through a large table of comments to find those for the relevant post would be expensive, and would be done every time a blog p...

How can I view my Android Apps database information?

I've tried to view the db file from the File Explorer in Eclipse but I can't open the file or copy it to another location to open. I don't have a rooted phone so I was trying to view the db from the app on my emulator. If someone could help it would be greatly appreciated as I find it hard to find much info on this subject for some reas...

NSInvalidException:NULLcString in iPhone using SQLite

Hi, I am displaying the contacts on the table. Section I pass in the method is name of section i.e. A-Z.. and the index is the index of the row in that particular section. So to get the id based on the row I tapped in particular section,I wrote the following method. I am trying to get the id from the database whose values match with the ...

How to store the index separately from the data on Azure?

I've read that a lot of websites store the index separably from the data. Specifically on Azure, the index will be stored in Azure SQL and the data stored in Azure Table Storage. This supposedly increases the performance and allows you to store a lot more data and query it efficiently. I'm not sure how to architect a system to do t...

Why am I getting a file exists -c: error

I am trying to use paperclip to upload a csv file to my rails application so I can parse it into the database, but whenever I select the file and try to upload it, the controller returns the error File exists - c: when it tries to save the instance. When I inspect the object in debugger mode I get this: #<Import id: nil, datatype: "use...

Funny characters in my db

My web app is breaking when I try edit a certain content type and I'm pretty sure it is because of some weird characters in my database. So when I do: SELECT body FROM message WHERE id = 666 it returns: <p>⢠<span></span></p><p><br /></p><p><em><strong>NOTE:</strong> Please remember to use your to participate in the discussion.</em>...

Rails -- How to setup model that can belong to either of 3 different models

I'm trying to make an app that does testing similiar to what you would experience in school. I have a model Question, which can belong to either an Exam, Quiz, or Assignment. Should I create fields for ":exam_id, :integer, :null => false; :quiz_id, :integer, :null => false; :assignment_id, :integer, :null => false;"? The question w...

How can I wrap tables into a more generic class for use with multiple data contexts?

I have two different DataContexts (SQL Databases) that have the same data, just with slightly different naming: DB1: Serialnumber Productnumber DB2: SerialNumber ProductNumber Result So I want to be able to wrap these tables in a class that will let me get back the serial number and product number regardless of the DataContext that it ...

MySQL Phone table: How to specify a unique primary contact number per ID?

My table is as follows: CREATE TABLE IF NOT EXISTS PHONES ( number VARCHAR(10), id INT, type VARCHAR(10), PRIMARY KEY (number), FOREIGN KEY (id) REFERENCES TECHNICIANS(id) ON DELETE CASCADE ) ENGINE = INNODB; I would like to specify for each id one primary contact number. I was thinking of adding a ...

Where does SQL Server 2005 keep the .mdf files?

I'm upgrading from SQL Server 2005 to 2008. I've detached the database I need, but can't find it on the file system. Where does a default installation of SQL Server 2005 store these? ...

MySql If statements

I have a simple table that logs simple events an administrator does. Nothing complicated. One of the columns is userid, so I can reference the user's name from the users table: SELECT u.username FROM `users` u, `history` h WHERE u.userid = h.userid My issue is that the internal system also logs events (just like a user), but there i...

MySql with more then one Column

I have this table ------------------ 1 | 20,00 | A | 2 | 20,00 | A | 3 | 20,00 | A | 4 | 20,00 | A | 1 | 50,00 | B | 2 | 50,00 | B | 3 | 50,00 | B | 4 | 50,00 | B | I wold like to produce this one using group by. id | A | B | ---------------------- 1 | 20,00 | 50,00 | 2 | 20,00 | 50,00 | 3 | 20,00 ...