Sample Header Ad - 728x90

create table based on another table

0 votes
1 answer
153 views
I have a table called " Product " it has: **ID_P**, **Name**, **expiration date** Now I want to create another table called "Stock" this table has **ID**, **Quantity_of_the_product**, **product_location_in_the_stock**, **ID_P** (foreign key), and **expiration date** I want to bring the expiration date from the table product I am new to SQL oracle so please be patient with me I am using: SQL ORACLE **UPDATE:** and is it right if I do this CREATE TABLE stock (ID, Quantity_of_the_product,product_location_in_the_stock, ID_P foreign key) AS SELECT expiration_date FROM Product WHERE stock.id_p = product.id_P
Asked by kylie (39 rep)
Jan 6, 2023, 08:34 AM
Last activity: Jul 14, 2025, 10:04 PM