Problem: When I use an auto-incrementing primary key in my database, this happens all the time:
I want to store an Order with 10 Items. The ordered Items belong to the Order. So I store the order, ask the database for the last inserted id (which is dangerous when it comes to concurrency, right?), and then store the 10 Items with the for...
I'm reading a book, where the author talks about fetching an row + all linked parent rows in one step. Like fetching an order + all it's items all at once. Okay, sounds nice, but really: I've never seen an possibility in SQL to ask for - lets say - one order + 100 items? How would this record set look like? Would I get 101 rows with mer...
I have a table my_table with these fields: id_a, id_b.
So this table basically can reference either an row from table_a with id_a, or an row from table_b with id_b. If I reference a row from table_a, id_b is NULL. If I reference a row from table_b, id_a is NULL.
Currently I feel this is my only/best option I have, so in my table (which ...
For example, I have a table that stores classes, and a table that stores class_attributes. class_attributes has a class_attribute_id and a class_id, while classes has a class_id.
I'd guess if a dataset is "a solely child of" or "belongs solely to" or "is solely owned by", then I need a FK to identify the parent. Without class_id in the ...
Hi,
I want my database to support multi Languages for all text values in its tables.
So what is the best approach to do that?.
Edit1::
E.G.
I've this "Person" table:
ID int
FirstName nvarchar(20)
LastName nvarchar(20)
Notes nvarchar(max)
BirthDate date
...........
So if i want my program to support new language "...
From Objective-C i'm used to Reference Counting / Retain Counting (same thing). I love this concept, and it's plain simple.
So I thought, why not apply this to a database? The problem is:
Imagine these tables: users, photos. A user can own a photo, a user can like a photo of himself or someone else, and a user can recommend a photo. In...
Hello. In my site, I'll be inviting people to contribute variety of content, like pictures, video, and things alike. Besides the core content, I'll be capturing meta data. Some meta data will be common across content types and some will be specific.
I am planning to have 1 table that accommodates universe of meta data with that many c...
Hello.
I need to migrate some tables in mysql db to oracle db.
Do you now any tutorial to learn about this migration?
Thanks
...
Whether we like it or not, many if not most of us developers either regularly work with databases or may have to work with one someday. And considering the amount of misuse and abuse in the wild, and the volume of database-related questions that come up every day, it's fair to say that there are certain concepts that developers should k...
I'm about to write some example applications and accompanying documents comparing ways of accessing information stored in relational databases. To demonstrate real-life requirements, I need to include a realistic dataset of hundreds of thousands of facts.
Is anyone aware of publicly available, free datasets of that magnitude, of dataset...
I'm now in the final stages of upgrading the hierarchy design in a major transactional system, and I have been staring for a while at this 150-line query (which I'll spare you all the tedium of reading) and thinking that there has got to be a better way.
A quick summary of the question is as follows:
How would you implement a hierarchi...
Using openoffice.org Base 3.1.1
Given the database below with three tables, I would like to create a query with the following output. How can this be achieved with queries or views?
output
book.title, tags
title 1, tagdescription1 tagdescription2 tagdescription3
title 2, tagdescription2
database
BOOK
id - primary key,title
1, title...
Is there some reliable (i.e. acknowledged) data on the execution times for various queries, such as different types of joins, scans, with different types and size of data? I am looking for the order of magnitude. This does not have to be vendor-specific data.
It should be similar in terms of presentation for latency for various access t...
SURVEYS table:
SurveyID
UserID
Question
Choice1
Choice2
Choice3
RESPONSES table:
UserID
SurveyID
Answer
The first desire (achieved): Show me all surveys that User 28 has initiated:
SELECT *
FROM Surveys
WHERE Surveys.UserID = 28
The second desire (achieved): Show me all surveys that User 28 has answered:
SELECT *
FROM...
I've got the following JSON structure that defines a table and it's data.
var arrTable =
[{"table": "tblConfig",
"def":
[{"column": "Property", "type": "TEXT NOT NULL"},
{"column": "Value", "type": "TEXT NOT NULL"}],
"data":
[{"Property": "VersionNumber", "Value": "1.0"},
{"Property": "ReleaseDate", "Value...
i have .dmp file of a database , dun know sqlserver or oracle....how can i read data from it ....extention is .DMP.......what to do.....
...
Let's say i have people who search for jobs, and i have a list of jobs.
So i have two tables:
people and jobs.
Now i have a list of skills of the person, and i have a list of skills for the job requirement.
What is better to have ONE skills table like this:
CREATE TABLE skills_reference
(
id INT,
reference_id INT, -- can reference peop...
Hey, I'm looking for the most efficient way to maintain an object relative auto-incrementing value. In other words, I have a table of objects, and a table of child objects. The child objects need to have a column, which increments relative to the other child objects for the same parent. (ie. child object 3 of parent object 4)
eg.
Paren...
I have an android list activity that is backed by a database cursor through a SimpleCursorAdapter.
When the items are clicked, a flag field in the coresponding row in the database is toggled and the view in the list needs to be updated.
The problem is, when the view that's updated goes off screen and is recycled, the old value is ...
For no reason in particular, I'm curious what the expected number of feet you would have to walk to find the nearest road is, starting from a random point on the world, facing a random direction. I can write a program to compute this value, given the right data source.
Is there any data source containing all the roads in the world? For ...