👋

Microsoft fabricとAzureのアーキテクチャ-②【Azure編】

2024/02/10に公開

やること

①.SQLDBにデータ(商品レビューデータ)をinsertする
②.DataFactoryでデータを取り込む
③.組み込みAIを使い、データを前処理する

SQLDBにデータ(商品レビューデータ)をinsertする

  1. Azure SQL Serverを構築
  2. Azure SQL DBを構築

https://learn.microsoft.com/ja-jp/azure/azure-sql/database/single-database-create-quickstart?view=azuresql&tabs=azure-portal

  1. SQL DBの「クエリエディター(プレビュー)」をクリック
  2. 1で構築した際に設定した、「ユーザー名」「パスワード」を入力し、「OK」をクリック
  3. 下記のクエリを入力し、「実行」をクリック
CREATE TABLE Product_review(
  id INT PRIMARY KEY,
  sex VARCHAR(10) ,
  age INT,
  comment VARCHAR(255)
);

  1. テーブルが作られることを確認

  2. 下記のクエリを入力し、「実行」をクリック

INSERT INTO Product_review(id, sex, age, comment) VALUES (1, 'male', 25, 'Great product!');
INSERT INTO Product_review(id, sex, age, comment) VALUES (2, 'female', 32, 'I love this product!');
INSERT INTO Product_review(id, sex, age, comment) VALUES (3, 'male', 45, 'Not as good as I expected');
INSERT INTO Product_review(id, sex, age, comment) VALUES (4, 'female', 28, 'Excellent product, will buy again!');
INSERT INTO Product_review(id, sex, age, comment) VALUES (5, 'male', 37, 'Product is too expensive for its quality');
INSERT INTO Product_review(id, sex, age, comment) VALUES (6, 'female', 29, 'Satisfied with the product');
INSERT INTO Product_review(id, sex, age, comment) VALUES (7, 'male', 40, 'The best product I have ever bought');
INSERT INTO Product_review(id, sex, age, comment) VALUES (8, 'female', 36, 'The product broke after few days');
INSERT INTO Product_review(id, sex, age, comment) VALUES (9, 'male', 23, 'Would highly recommend this product');
INSERT INTO Product_review(id, sex, age, comment) VALUES (10, 'female', 50, 'Not worth the money');
INSERT INTO Product_review(id, sex, age, comment) VALUES (11, 'male', 35, 'Could be better');
INSERT INTO Product_review(id, sex, age, comment) VALUES (12, 'female', 45, 'I had a terrible experience with this product');
INSERT INTO Product_review(id, sex, age, comment) VALUES (13, 'male', 32, 'Product arrived late');
INSERT INTO Product_review(id, sex, age, comment) VALUES (14, 'female', 37, 'I found the same product cheaper elsewhere');
INSERT INTO Product_review(id, sex, age, comment) VALUES (15, 'male', 28, 'Product is good but customer service was poor');
INSERT INTO Product_review(id, sex, age, comment) VALUES (16, 'female', 42, 'Very satisfied');
INSERT INTO Product_review(id, sex, age, comment) VALUES (17, 'male', 38, 'Average product');
INSERT INTO Product_review(id, sex, age, comment) VALUES (18, 'female', 30, 'High quality product');
INSERT INTO Product_review(id, sex, age, comment) VALUES (19, 'male', 35, 'I will not buy this product again');
INSERT INTO Product_review(id, sex, age, comment) VALUES (20, 'female', 40, 'Great value for the price');


8. 下記のクエリを入力し、「実行」をクリック

SELECT * FROM Product_review;
  1. テーブルにデータがinsertされていることを確認
ヘッドウォータース

Discussion