How to refer the foreign key in correspond table to reference table

Create table cart_order(
order_id INT,
customer_id INT,
product_id INT,
quantity INT,
order_date DATE,
status VARCHAR(100),
PRIMARY KEY (order_id),
FOREIGN KEY (customer_id) REFERENCES customer(customer_id),
FOREIGN KEY (product_id) REFERENCES product(product_id)
);






-Find out the number of unique countries of the customers in the customer table

SELECT COUNT(DISTINCT country)

FROM customers;


- SELECT DISTINCT BillingCountry, BillingCity

FROM invoices

ORDER BY BillingCountry, BillingCity;

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center