In relational database design, a primary key can uniquely identify each row in a table. A primary key comprises a single column or a set of columns.
0
votes
2answers
48 views
Can a surrogate key and a primary key be in the same table?
For example we have:
Surrogate key: ABC123
Primary key: 1
Name: James
Is this legit in a Data Warehouse table?
0
votes
1answer
20 views
Candidate key = Key = Minimal Superkey?
I got a little confused by all these keys. As I understand
A key of a relational schema =
The minimal subset of a superkey that is still a key =
A candidate key
Is this correct or not?
3
votes
0answers
205 views
Why are runtimes different for a table including a primary key versus a table with a clustered unique index added after population
When I create a temporary table with a PK defined from the outset like this I get great performance in subsequent joins on that key:
create table #temp (
field1 int not null
field2 int ...
2
votes
0answers
124 views
How can I manage Primary Key length limit of 900 bytes when using hirarchyid 2 columns?
I have to define a Primary key on a table which has following 4 columns and its data types.
GSiteID hirarchyid,,
SiteID varchar(10),
GComID hirarchyid,
ComID nvarchar(10)
As we know there is limit ...
0
votes
0answers
39 views
is it good to use combined primary key for MySQL InnoDB clustered index?
I'm trying to build a aggregated reader website of multiple forums.
Because most queries are likely to be within same time periods for written_time column,
I'm thinking about taking advantage of ...
0
votes
0answers
24 views
Postgresql Retrieve / Find Primary Key Serial Autonumber field for Audit logs
I need to find the Primary Key field name in each of a number (approx 70) of tables to create audit logs.
All the primary keys are type serial (auto incrementing integer) and all have the name in the ...
0
votes
0answers
112 views
setting timestamp column as pk to prevent concurrent editing of records?
While I was familiarizing myself with all the new data types in MySQL, I noticed the TIMESTAMP data type, and thought "What if I make this TIMESTAMP field and the CustomerID field (the other pk) a ...
