Questions tagged [relational]
526 questions
11
votes
1 answer
SQL two tables and creating a link table
I have two tables: Employee (ID, Name, Address) and Store(ID,Address) and I would like to record information about people who work in each store.
I thought of making a new table called Employee_List table. My questions:
1- Employee_List and Employee…

hamid
- 2,033
- 4
- 22
- 42
10
votes
7 answers
What are the pros and cons of object databases?
There is a lot of information out there on object-relational mappers and how to best avoid impedance mismatch, all of which seem to be moot points if one were to use an object database. My question is why isn't this used more frequently? Is it…

Kevin Pang
- 41,172
- 38
- 121
- 173
10
votes
2 answers
What are the academic names for the left and right operands in binary relational operator?
Relational operators such as <, >=, == are often not bidirectional. What are the correct names for the operands to these operators? An example from an non-relational operator, division, would be the operand names divisor and dividend.

Matt Joiner
- 112,946
- 110
- 377
- 526
10
votes
1 answer
How does `std::less` work?
Pointer relational operators do not define a total order (§ 5.9 of the C++11 standard):
If two pointers p and q of the same type point to different objects that are not members of the same object or elements of the same array or to different…

rom1v
- 2,752
- 3
- 21
- 47
10
votes
3 answers
What is the difference between an entity relationship model and a relational model?
I was only able to find the following two differences:
The relationships in an E-R model are explicitly defined, while they are implicit in a relational model.
Relational models require an intermediate table (often called a "junction table") to…

Shailesh
- 2,116
- 4
- 28
- 48
10
votes
2 answers
How can I access the last inserted row ID within a SQL script?
I'm using SQLite, and I have a table for properties, and a table for sub-properties. Each sub-property points to its parent using the fkPropertyId column. Right now, to create the initial database, I've got a script that looks something like…

Ed Marty
- 39,590
- 19
- 103
- 156
9
votes
4 answers
(De)Normalization of two relations
People who read C.J.Date's Introduction to Database System or books of similar level should not have problems with definition of normalization and denormalization.
However, memory is not what it used to be and I find myself often looking at some…

Unreason
- 12,556
- 2
- 34
- 50
9
votes
3 answers
Relational Algebra - Cartesian Product vs Natural Join?
I am studying for exams and am failing to find a solid criteria by which I can determine if the Cartesian Product x is to be used or if Natural Join |X| is to be used.
I had come up with a rough guide that:
"If you need to project an attribute that…

Myles Gray
- 8,711
- 7
- 48
- 70
8
votes
1 answer
What does it mean to compare pointers using relational operators?
If I have two pointer variables, a and b, what does it mean to to use the statement "a < b"? Is doing so supposed to compare the values of their memory addresses? If so, what would be the order of memory addresses in the computer?

Frank Liu
- 81
- 2
8
votes
3 answers
Django migrations/South: New column take default value another value from the same record
I want to add a new column to an already existing table, but I want to give it a default value dependent on already existing data:
e.g. Each record has a start_date. Now I want to add an open_until column, and I want to fill it with the value for…

confused00
- 2,556
- 21
- 39
7
votes
6 answers
Relational DB in-memory?
I have a simpleton question on Redis. If the key to it's performance is that it's in-memory, whey can't that be done on a regular SQL db?

ilupper
- 225
- 1
- 4
- 10
7
votes
2 answers
Shredding data from XML, Importing into Relational Tables (SQL Server 2008)
I have looked everywhere for help on this.
I'm new to all this and I'm finding it hard to understand all the documentation on it.
Say I have this XML:
Liverpool
…
user1320771
6
votes
4 answers
Storing folder hierarchy in relational database
I have objects representing folders and I'm wondering if they should be represented in the database.
On the one hand it seems like the easiest way would be to not represent folder objects and just store a path value for objects contained in a…

Davy8
- 30,868
- 25
- 115
- 173
6
votes
7 answers
How to Convince Programming Team to Let Go of Old Ways?
This is more of a business-oriented programming question that I can't seem to figure out how to resolve. I work with a team of programmers who have been working with BASIC for over 20 years. I was brought in to help write the same software in…

Austin
- 834
- 1
- 10
- 21
6
votes
8 answers
What is the best way to represent a many-to-many relationship between records in a single SQL table?
I have a SQL table like so:
Update: I'm changing the example table as the existing hierarchical nature of the original data (State, Cities, Schools) is overshadowing the fact that a simple relationship is needed between the items.
entities
id …

GloryFish
- 13,078
- 16
- 53
- 43