database

What should a student be taught about database transactions?

There's lots that can be taught about transactions in databases (and I'm really talking about relational databases here, since that's what I'm currently teaching), but I believe it's easy to teach the wrong things. Given that students are very likely going to forget most of what you say before they leave the lecture room, where should th...

Storing user data as text or ID based using lookups?

Is there any benefit to storing Days of weeks, Months, Week number, user age, etc as Lookups vs plain text entry into the database? I am creating a social website with some analytic and planning to use a Question table, Answer table and Question_Answer table to store all the data like Gender, Birth months, Age, etc so I can give each an ...

SQLite database file created from JDBC?

Hi everybody, I have created a SQLite database from Java. Now I want to know where it is stored physically on disk, so that I can use push that file on to Android. ...

Search array for values from database

I have a database filled with employee ID's and corresponding employee names for each employee ID. Is there a way I can search an array for employee ID's from the database? Google is not helping me, I think because I'm not sure how to word my search. My idea is to have something like, array_search($empID, $currentArray). And then loop t...

Is there a reason for a Primary Key column that would never be used?

I have a routine that will be creating individual tables (Sql Server 2008) to store the results of reports generated by my application (Asp.net 3.5). Each report will need its own table, as the columns for the table would vary based on the report settings. A table will contain somewhere between 10-5,000 rows, rarely more than 10,000. Th...

Is there a reason why certain sites don't allow periods in passwords?

I was just wondering why certain website don't allow anything other than letter and numbers in the password field. Is there a security reason or perhaps it's just a limitation of the DB they are using? Thanks for the info. Edit: It appears that Oracle's database doesn't acknowledge uppercase and lowercase? Is this true? I was told that...

Create date from day, month, year fields in MySQL

Hello, I am currently developing an application that displays documents and allows the members to search for these documents by a number of different parameters, one of them being date range. The problem I am having is that the database schema was not developed by myself and the creator of the database has created a 'date' table with f...

MySQL: Return fields where COUNT(*) is greater than ...

I've got the following SQL, but I only want to return rows where 'hits' are greater than 10. SELECT clicks.affiliate, COUNT(*) AS hits, affiliates.title, affiliates.url FROM clicks INNER JOIN affiliates ON affiliates.id = clicks.affiliate GROUP BY clicks.affiliate Thanks. ...

Cannot open backup device. Operating System error 5.

Hello everyone, Below is the Query that I am using to backup (create a .bak) for my database. However, whenever I run it, i always get this error message: Msg 3201, Level 16, State 1, Line 1 Cannot open backup device 'C:\Users\Kimpoy\Desktop\Backup\AcinsoftDB.Bak'. Operating system error 5(Access is denied.). Msg 3013, Level 16, State...

query not working with empty fields on access

What is wrong in this query running on MS Access 2003 database. It works fine if fields are not empty, but when any of the fields is empty it results empty string. SELECT CustomerName,IIF(Address1="","",Address1)+IIF(Address1& Address2="","",",")+IIF(Address2="","",Address2)+IIF(Address1&Address2& Address3="","",",")+IIF(Address3=" ","...

How do you merge tags on an already existing system

We have a simple interface to tag a particular question (e.g. entry has 1..many tags and each tag entry has a foriegn key pointer back to the entry table) 1. What is the current production version of the jdk? (Tags: jdk6 jdk-6 jdk java) 2. In what version was java.util.spi package introduced? (Tags: jdk-6, jdk7, jdk5) 3. Whic...

Creating a subscription based business model

are there any programs that allow you to determeine the amount of subscriptons needed to show a profitable business model? (The question is asked because I am trying to create a business that will be based on subscrptions.) ...

Can't use ActiveRecord associations Rails 3 in IRB

I have three classes with the following associations: class Technician < ActiveRecord::Base has_many :tickets has_many :services, :through => :tickets end class Ticket < ActiveRecord::Base belongs_to :technician has_many :services end class Service < ActiveRecord::Base belongs_to :ticket belongs_to :technicians end W...

changes are not being reflected in when getting the result after insert thru hibernate

Hi, I am using hibernate and spring mvc, when i insert a record in DB, and try to access that that right after that, then i don't get the result. e.g. if insert a record for newly reg. user and login in him right after registering it then result set is empty. I am using hibernate templates. what could be the problem and what i am m...

What's the point of a candidate key?

I'm fairly new to database management and this question never seems to be answered in more than one sentence. All other SO answers say "A candidate key is a minimal super key." That means nothing to me. A candidate key is supposed to specify uniqueness of a db record, correct? And a primary key is a candidate key. If a primary key alrea...

Apply the unique constraint to combinations of columns in SQL

Hi, I have a table called product_attributes in a MySQL Database. It consists of a product SKU (foreign key), an attribute label and an attribute value. I need to ensure that combinations of SKU and attribute labels are unique. EXAMPLE - inserting this would be legal {001, 'weight', '100 lbs'} {001, 'color', 'blue'} {002, 'weight'...

Easiest Way To Diff Two Table Schemas In SQL Server 2008?

I have to do checks between a development and release database and do this manually, which is both slow and not 100% reliable (I only visually inspect the tables). Is there a quick and easy way to compare table schemas automatically? Maybe even a feature that does this built right into SQL server? Edit: I'm comparing structure only, t...

How to view live database connections in a databse pool?

Hi, We use database connection pooling for our java application. It is a web app run under tomcat. I want to view live connections in the pool as they are created and destroyed. Can somebody please help? UPDATE: We are using Oracle 11g. We use DDConnectionBroker library for connection pooling. ...

create mysql database on mac os x

I know this sounds a little ridiculous, but I'm just honestly wondering how I can create a MySQL database on my Mac OS X machine. I have MySQL installed (as far as I know) as well as PHP, and I'm wondering how I can create one. I have downloaded a sample PHP ecommerce site to kind of delve into what I'm trying to familiarze myself with...

How to connect to a remote MySQL DB without webservices... ? (ANDROID)

Hi can i do it? I just wanna make SELECT/INSERT into a remote database, i think it have to be easy but i can't find the way. I only find people that tell i have to make a webservice or something like that, but that is another world for me, and i can't put a webservice in the database host... ¿there is not a normal way to do it without ...