我正在将数据插入到我制作的名为“ PC”的新表中,我的代码肯定有问题。谁能识别我在哪里犯错?这是我仅使用mysql btw的第一个表。我对此很陌生,但是我对到目前为止我们所介绍的材料有相当的了解。 t
Insert into PC (PC_ID, Vendor, Model, Price, Notes)
Values ('pc1', 'Dell', 'XPS 27 All-in-One', 2700,'Staff-pc'),
('pc2','Apple','Macbook Pro', 2800, 'Laptop-mac'),
('pc3','Apple','Macbook Pro', 2800,'Laptop-mac'),
('Pc4','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc5','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc6','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc7','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc8','XPS 1370','XPS 1370', 1200, 'Laptop-pc'),
('Pc9','XPS 1370','XPS 1370', 1200, 'Laptop-pc'),
('Pc10','XPS 1370','XPS 1370', 1200, 'Laptop-pc')
答案 0 :(得分:0)
我唯一看到的是分号。
CREATE TABLE PC (PC_ID TEXT, Vendor TEXT, Model TEXT, Price REAL, Notes TEXT);
Insert INTO PC (PC_ID, Vendor, Model, Price, Notes)
VALUES
('pc1', 'Dell', 'XPS 27 All-in-One', 2700,'Staff-pc'),
('pc2','Apple','Macbook Pro', 2800, 'Laptop-mac'),
('pc3','Apple','Macbook Pro', 2800,'Laptop-mac'),
('Pc4','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc5','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc6','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc7','Lenovo','IdeaCenter 730', 820, 'Staff-pc'),
('Pc8','XPS 1370','XPS 1370', 1200, 'Laptop-pc'),
('Pc9','XPS 1370','XPS 1370', 1200, 'Laptop-pc'),
('Pc10','XPS 1370','XPS 1370', 1200, 'Laptop-pc');
SELECT * FROM PC;
非常适合我。