how to create a table using java language with primary key and foreign key
A foreign key is a field (or fields) that points to the primary key of another table.
CREATE TABLE CUSTOMER (SID integer, FirstName varchar(40), LastName varchar(40), Primary Key (SID )); CREATE TABLE ORDERS (Order_ID integer, Order_Date date, Customer_SID integer, Amount double, Primary Key (Order_ID), Foreign Key (Customer_SID) references CUSTOMER(SID));
For more information, visit the following link:
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.