112 questions
1
vote
0
answers
165
views
Hash as primary Key versus BigInt, read/write performance
I have an unlogged postgresql table holding three columns: 'key' of type varchar (255) hosting immutable sha256hex strings, 'created_at' of type timestamp without time zone and 'json' of type text.
To ...
0
votes
1
answer
593
views
Oracle APEX Creating surrogate keys for composite PK
I have two tables I need to process.
One table "Delivery" contains id of delivery as PK, id of storage to deliver as FK and id of storekeeper as FK.
The other table "Delivery_log" ...
0
votes
1
answer
308
views
How to lookup a surrogate key using two columns as business key in SSIS
I am working on a Data warehouse project; I have a design to follow a part of it is shown in the screenshot below:
The source table is as follows:
As the source table shows, the entity column is not ...
-2
votes
1
answer
64
views
How to sort relational table without surrogate PK by insertion order?
Say I have a JOB and COMPANY table and a third JOB_COMPANY table that relates the two in a many-to-many cardinality.
I've learnt that it's an anti-pattern for the JOB_COMPANY to have a surrogate id PK....
0
votes
1
answer
473
views
How to populate fact table with Surrogate keys from dimensions?
Could someone please help me understand how to populate the fact table with Surrogate keys from dimensions using SSIS?
I load my dimension tables and assign for each a surrogate key. I want to add ...
-1
votes
1
answer
57
views
is the key we use in phpmyadmin is a primary key or a surrogate key?
What's the difference between a primary key and surrogate key if both are unique keys.
The primary key acts same as a surrogate key in phpmyadmin.
I have heard in a video that a surrogate key is ...
1
vote
3
answers
7k
views
Is there a function to easily create a surrogate key in Snowflake?
Is there an easy/efficient way to create surrogate keys in Snowflake?
Imagine this data set is going to be selected into in a table,
during the insertion a battery_id column is added, which is the ...
0
votes
1
answer
164
views
Formatting the surrogate key based on other columns
I have a table in SQL Server
create table student
(
id int,
batch varchar(10),
branch varchar(10),
registerNumber varchar(30)
)
I want my registerNumber to be of type batch+branch+id
...
1
vote
1
answer
4k
views
DBT 'dbt snapshot' command resulting in error: "Database Error in snapshot snapshot_name Unrecognized name: id at [53:13]"
As the question says, I am running the dbt snapshot command and a few of my snapshots are not working because DBT is not recognizing the surrogate key id that I created. My snapshots are all built the ...
1
vote
1
answer
141
views
How to get the correct table as a Fact Table with relevant keys?(Star Schema)
I have a problem to select the suitable table for the fact table.
I have problem with following two tables
OrderData Table :
OrderID
CustomerID
OrderStatus
OrderPurchaseAt
OrderAprovedAt
...
0
votes
1
answer
194
views
Splitting a database with surrogate keys into physical and logical layer
I am rebuilding a big warehouse database which originally used natural keys, and now I want to switch to surrogate keys.
Therefore, I am considering to split the database into a physical layer and a ...
2
votes
1
answer
373
views
Surrogate Key Mapping for large (50 Million) keysets in Apache Flink
I have a use case where the apache flink process must integrate near real-time data streams (events) from multiple sources but due to lack of uniform keys in the different systems I need to use a ...
0
votes
1
answer
2k
views
Creating Surrogate Keys in Access
I have a project that I am working on where we have to create a registration system for a university in Access. One of the tables requires a surrogate key for one of the fields, and I am not sure how ...
2
votes
2
answers
2k
views
How surrogate keys are handles in hive
I know that hive cannot create surrogate keys or is rather difficult. I want to understand how companies have implemented dimensional modeling in their warehouse.
One way I can think of is leaving ...
0
votes
5
answers
554
views
How to avoid mistakes at Primary Key
Hi I'm a beginner at Databases, for this reason I want to ask you which atributes should I use as primary key to avoid mistakes:
CREATE TABLE customer(
name
first_lastname
street
...
0
votes
0
answers
222
views
MySQL - "Prefixed IDs"?
Im working on a project, where I need to insert various "Products", BUT depending on the type (fixed amount of 3, won't change customer said) the "ID" should start with a certain number (2,3,4)
While ...
0
votes
2
answers
105
views
Surrogate-key in ViewModel instead of primary-key
Is there a best practice how to prevent showing autoincrement primary-key's (ID's) from database in the ViewModel, to not make them visible for end-user?
I know there can be other unique fields on ...
1
vote
1
answer
109
views
What are the type of data problems that relational databases have when they are designed using natural keys (and not surrogate keys)?
I saw this comment:
[applications] with the most data-related problems were those using natural keys.
Source: Surrogate vs. natural/business keys
I want more supporting evidence of this, as the ...
1
vote
1
answer
2k
views
Using single column table
I'm creating a database to store the events of mobile apps recovered from multiple sources. Problem is that rows from the event table don't have much meaning to the user as it's mostly a succession of ...
1
vote
1
answer
350
views
Dimension with a surrogate key into itself (Data Warehouse)
I have an Employee dimension that I am using SCDs and Surrogate keys to track changes over time.
Employee's business system key: EmployeeID
Employee Surrogate key: EmployeeSCDKey
I would like to ...
0
votes
1
answer
724
views
Is there a way to auto increment a column with respect to the foreign key in DB2?
Say I have an address table with the addresses of different facilities of a manufacturing company.
The foreign key lets me know which company the addresses belong to, but i need a surrogate id to ...
0
votes
1
answer
1k
views
Why surrogate keys are needed?
I am reading about DW modeling and started wondering why surrogate keys are used at all?
I understand that sometimes business keys are not integers nthat makes the life (as well as joiing and ...
0
votes
2
answers
131
views
Creating custom surrogate key in pig
Is there any way to create a custom surrogate key in Pig?.
Ex: we have data like below
Salary City Name
20000 newyork john
30000 sydney joseph
60000 delhi mike
30000 sydney joseph
And for ...
0
votes
1
answer
114
views
Table design for an ordered tree with composite keys
Consider the following designs for a node table that describes an ordered tree. The key is a composite key.
ck: composite key
parent: parent node
next: the next node, where the next.parent = parent.
(...
4
votes
3
answers
5k
views
creating dimension surrogate keys
I understand there are good reasons for using surrogate keys in data warehouse dimensions.
Still, I do not understand how I can link them to my fact table's foreign keys.
In the fact table I have only ...