logo

Crowdly

Browser

Add to Chrome

Terdapat skema table seperti berikut: CREATE TABLE products (   product_id I...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Terdapat skema table seperti berikut:

CREATE TABLE products (

  product_id INT AUTO_INCREMENT PRIMARY KEY,

  sku VARCHAR(10) UNIQUE,

  name VARCHAR(50)

);

CREATE TABLE sales (

  sale_id INT AUTO_INCREMENT PRIMARY KEY,

  product_id INT,

  quantity INT,

  sale_date DATE,

  FOREIGN KEY (product_id) REFERENCES products(product_id) ON DELETE SET NULL

);

INSERT INTO products (product_id, sku, name) VALUES

(1,'P001','Pens'),

(2,'P002','Buku');

INSERT INTO sales (sale_id, product_id, quantity, sale_date) VALUES

(1,1,10,'2025-09-10'),

(2,NULL,5,'2025-09-10'),

(3,2,3,'2025-09-11');

Lalu query seperti berikut:

SELECT p.sku, p.name, s.quantity

FROM products p

RIGHT JOIN sales s ON p.product_id = s.product_id

WHERE s.sale_date = '2025-09-10'

ORDER BY s.quantity DESC;

Berdasarkan skema dan query di atas, manakah dua pernyataan berikut yang benar?

0%
100%
0%
100%
0%
More questions like this

Want instant access to all verified answers on lms.smktarunabhakti.sch.id?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome