Member Avatar for [NOPE]FOREVER

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);


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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.