5

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

Thankyou

Votes + Comments
tested
jew
2
Contributors
1
Reply
12
Views
3 Years
Discussion Span
Last Post by hericles
1

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.