Questions tagged [compound-key]

Questions regarding usage of compound key (specific composite key) in database

76 questions
0
votes
1 answer

pyspark reduce key being a tuple values nested lists

My problem is the following: I am parsing users interactions, each time an interaction is detected I emit ((user1,user2),((date1,0),(0,1))). The zero's are here for the direction of the interaction. I cannot figure out why I cannot reduce this…
HorusH
  • 231
  • 1
  • 5
  • 14
0
votes
1 answer

Oracle SQL 12c How to correctly use compound foreign keys in compound primary keys?

DISCLAIMER: I am a student. I do not work for an airline. I do not pretend to be a professional programmer. Greetings, I want understand what I need to correct in order for these tables to work together. I'm sure it is obvious, but it isn't to me.…
0
votes
2 answers

Remove rows with duplicate primary compound key

I have a table consisting of the following integer columns: group_id, person_id, sequence Ideally, the primary key would be (group_id, person_id), but there are some duplicates I need to remove first. Whenever there are duplicates, I want to keep…
Rachie
  • 433
  • 1
  • 6
  • 17
0
votes
3 answers

MySQL UNIQUE KEY design: compound INT + VARCHAR key vs. single-col VARCHAR key

I am considering the following schema for a MySQL 5.6 InnoDB table. I'm having trouble deciding which keys to use: "CREATE TABLE IF NOT EXISTS `context` (" " `text_id` INT NOT NULL AUTO_INCREMENT," " `doc_id` INT NOT NULL," " …
0
votes
2 answers

Part of a compund key as a foreign key avoiding redundancy

Hello I have a database like this. As you can see it is a Hotel database which is holding all the information about bookings,customers and rooms. The problem is with the bookings and BookDates tables. Every customer that makes a booking can book few…
0
votes
3 answers

Unique on Compound Columns

I am trying to ensure that the values in RESTAURANTID and TABLENUMBER, together, are Unique using PowerDesigner (12.5). I've tried creating an alternate key which resulted in the following in my .sql file: create table TABLES ( TABLEID …
user2268507
0
votes
0 answers

How do I annotate a hibernate OneToMany relationship to a table with a compound id?

I am trying to create a OneToMany relationship between two tables where the destination table has a compound id. One column of the compound id is the one I want to key to, yet I can't figure it out. Example tables: TABLE EXCHANGE_RATE ( …
Steve L
  • 783
  • 3
  • 8
  • 15
0
votes
1 answer

Compound key reverse engineering grails pulgin issue

i have this table : CREATE TABLE `documents_revisions` ( `es_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `seq_head` int(10) unsigned NOT NULL, `member_id` int(10) unsigned NOT NULL, `file_id` varchar(512) COLLATE utf8_unicode_ci NOT…
Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254
0
votes
1 answer

Issue with MySQL Compound Primary Key

I am having an issue with a table the uses a compound primary key. The key consists of a date followed by an bigint. Selects on the table look to be scanning even when only selecting fields from the PK and using a where clause that contains both…
Richard Pogson
  • 55
  • 1
  • 1
  • 3
0
votes
1 answer
0
votes
1 answer

ssas compound dimension key

I'm using SSAS Visual Studio 2010. I have a dimension with a compound key pointing to a fact table. To begin with, the compound key contained three keys, and now I need to add a fourth. I did this in the DSV by clicking between the arrow between…
BrainE
  • 1
0
votes
0 answers

Which JPA annotations to use for compound PK and FK?

I have the following Java classes with JPA 2.0 annotations: @Entity public class A { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; } Also classes B and C which are very similar. Next I have Class AB which has a…
NickJ
  • 9,380
  • 9
  • 51
  • 74
0
votes
1 answer

Astyanax getKey with compound key

I would like to run the following code with a compound primary key. Column result = keyspace.prepareQuery(CF_COUNTER1) .getKey(rowKey) .getColumn("Column1") .execute().getResult(); Long counterValue =…
Peter Klipfel
  • 4,958
  • 5
  • 29
  • 44
0
votes
3 answers

Denormalize data or multiple-column key?

I'm trying to make a judgment call in implementing a small-ish SQL Server '08 database. I'm translating an output text file of a flat-file database from an old COBOL system to the aforementioned SQL Server database. It's a database of vehicle and…
Jim Dagg
  • 2,044
  • 22
  • 29
0
votes
1 answer

CompoundPropertyModel Wicket - Object graphs

I'd like to use the CompoundPropertyModel in Wicket for creating a user. My user class looks like this: public class User { private String username; ... private Address address; ... } public class Address{ …
Soccertrash
  • 1,830
  • 3
  • 28
  • 48