Information Technology IT – 10 Database and file concepts | e-Consult
10 Database and file concepts (1 questions)
Login to see all questions.
Click on a question to view the answer
Question 1 Answer:
1. Create the products table:
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(255),
price DECIMAL(10, 2)
);
2. Insert a new product into the products table:
INSERT INTO products (productid, productname, price)
VALUES (101, 'Wireless Headphones', 79.99);
3. Update the price of an existing product:
UPDATE products
SET price = 89.99
WHERE product_id = 101;