Member Avatar

I have 3 tables --Ticket_Lines (parent), Labour_Items (child), Part_Items (child).

Table Ticket_Lines has 2 primary keys (ticket_number & ticket_line_number)

I know that you cant have two seperate primary keys in one table so would this mean that ticket_number and ticket_line_number is a composite primary key?

if that is correct, is this the best way of defining a composite primary key?

CONSTRAINT PRIMARY KEY (ticket_number, ticket_line_number);


thelove commented: tested +0
joyc123 commented: jew +0

That is correct. PRIMARY KEY (column1, column2...) will create a primary key using the columns specified.