Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Using INSERT | CRUD Operations with MySQL
Introduction to .NET with C#

bookChallenge: Using INSERT

メニューを表示するにはスワイプしてください

In the last task, we created a table that stores the products of a grocery store. They contact you again to fix the previous table making sure that the id of each item in the products table is unique. They also want you to insert the following data into the table:

object[,] groceryItemsData = new object[,]
{
    { "Bananas", "Fruits", 0.99f, 150 },
    { "Apples", "Fruits", 1.49f, 100 },
    { "Carrots", "Vegetables", 0.79f, 200 },
    { "Potatoes", "Vegetables", 1.29f, 180 },
    { "Milk", "Dairy", 2.49f, 80 },
    { "Eggs", "Dairy", 1.99f, 120 },
    { "Bread", "Bakery", 1.99f, 90 },
    { "Chicken", "Meat", 4.99f, 50 },
    { "Rice", "Grains", 3.99f, 120 },
    { "Pasta", "Grains", 1.49f, 150 }
};

Your task is to:

  1. Create a new table called store and, this time, make the id column a primary key and set it to automatically increment;
  2. Insert the data given in the groceryItemsData array into the new table.

すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 4.  6

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

セクション 4.  6
some-alt