This topic provides sample data for demonstration purposes. You can use this data to quickly build a test environment and integrate APIs into your projects.
Prerequisites
-
You have activated Alibaba Cloud Model Studio.
-
You have obtained a Workspace ID. For more information, see Get a Workspace ID.
-
You have obtained an AccessKey ID and an AccessKey secret. For more information, see Obtain an AccessKey and AgentKey.
-
The
AliyunDataAnalysisGBIFullAccessaccess policy is attached to the Resource Access Management (RAM) user. For more information, see Manage RAM user permissions. -
You have authorized and connected to a database on the Data Table Management page of Xiyan GBI. For more information, see Database connection.
Procedure
Step 1: Prepare the data
To demonstrate the basic features, import the following sample data into your database.
CREATE TABLE products (
product_id INT AUTO_INCREMENT PRIMARY KEY COMMENT 'Product ID',
product_name VARCHAR(255) NOT NULL COMMENT 'Product name',
price DECIMAL(10, 2) NOT NULL COMMENT 'Product price',
category VARCHAR(255) NOT NULL COMMENT 'Product category',
in_stock_quantity INT NOT NULL COMMENT 'Quantity in stock',
create_date DATE NOT NULL COMMENT 'Creation date, in YYYY-MM-DD format',
INDEX category_idx (category)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT 'Stores product information';
CREATE TABLE `customers` (
`customer_id` int NOT NULL AUTO_INCREMENT COMMENT 'Customer ID',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'Customer name',
`email` varchar(255) NOT NULL COMMENT 'Customer email',
`join_date` date NOT NULL COMMENT 'Join date, in YYYY-MM-DD format',
PRIMARY KEY (`customer_id`),
KEY `name_idx` (`name`) COMMENT 'Index by name for query optimization',
KEY `email_idx` (`email`) COMMENT 'Index by email for query optimization'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Stores customer information';
CREATE TABLE orders (
order_id INT AUTO_INCREMENT PRIMARY KEY COMMENT 'Order ID',
customer_id INT NOT NULL COMMENT 'ID of the customer who placed the order',
product_id INT NOT NULL COMMENT 'ID of the ordered product',
order_date DATE NOT NULL COMMENT 'Order date, in YYYY-MM-DD format',
quantity INT NOT NULL COMMENT 'Quantity of the ordered product',
order_status VARCHAR(50) NOT NULL COMMENT 'Order status (for example: Pending, Shipped, Delivered)',
INDEX order_date_idx (order_date) COMMENT 'Index by order date for query optimization',
INDEX customer_product_idx (customer_id, product_id),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id) ON DELETE CASCADE,
FOREIGN KEY (product_id) REFERENCES products(product_id) ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT 'Stores order information';
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (1, 'Su Bin', 'jiehao@example.com', '2024-03-01');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (2, 'Chen Jianguo', 'qinjuan@example.net', '2023-12-05');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (3, 'Ye Guizhi', 'chaoyin@example.net', '2024-05-24');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (4, 'Zhao Fei', 'yinxiulan@example.net', '2023-05-14');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (5, 'Zhang Qiang', 'juansu@example.org', '2023-07-04');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (6, 'Mao Shuzhen', 'leibai@example.com', '2023-07-29');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (7, 'Deng Rui', 'tianli@example.com', '2022-11-26');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (8, 'Zhang Hong', 'huangyong@example.org', '2024-07-02');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (9, 'Hu Yulan', 'lizheng@example.org', '2024-04-10');
INSERT INTO `customers` (`customer_id`, `name`, `email`, `join_date`) VALUES (10, 'Li Kun', 'ping59@example.com', '2024-01-14');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (1, 'Eye-protection Desk Lamp', 1837.00, 'Digital Products', 16, '2023-12-31');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (2, 'Portable Juicer', 584.82, 'Digital Products', 98, '2024-04-15');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (3, 'Wireless Bluetooth Headphones', 1368.97, 'Digital Products', 26, '2024-05-01');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (4, 'Air Fryer', 760.15, 'Digital Products', 76, '2024-05-19');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (5, 'Huawei P30 Phone', 886.24, 'Digital Products', 1, '2024-10-20');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (6, 'Smartwatch', 1217.32, 'Digital Products', 52, '2024-01-21');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (7, 'Automatic Soy Milk Maker', 1162.19, 'Digital Products', 61, '2023-10-31');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (8, 'Xiaomi Wristband', 91.26, 'Digital Products', 2, '2024-02-24');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (9, 'Makeup Brush Set', 1410.57, 'Digital Products', 90, '2024-08-27');
INSERT INTO `products` (`product_id`, `product_name`, `price`, `category`, `in_stock_quantity`, `create_date`) VALUES (10, 'Electric Kettle', 823.79, 'Digital Products', 61, '2023-11-04');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (1, 2, 8, '2023-12-12', 7, 'Delivered');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (2, 1, 7, '2024-03-05', 5, 'Delivered');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (3, 3, 9, '2024-06-11', 1, 'Shipped');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (4, 5, 10, '2024-01-20', 6, 'Pending');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (5, 10, 1, '2024-04-25', 10, 'Pending');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (6, 4, 8, '2024-06-11', 7, 'Shipped');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (7, 9, 6, '2024-01-05', 6, 'Shipped');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (8, 2, 5, '2024-07-13', 2, 'Pending');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (9, 8, 7, '2024-01-18', 2, 'Shipped');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (10, 5, 10, '2024-09-23', 2, 'Delivered');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (11, 7, 7, '2024-07-06', 3, 'Delivered');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (12, 1, 2, '2024-08-02', 5, 'Shipped');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (13, 2, 7, '2024-07-12', 4, 'Pending');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (14, 3, 9, '2024-03-18', 3, 'Pending');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (15, 9, 8, '2024-06-19', 8, 'Delivered');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (16, 9, 8, '2023-12-18', 4, 'Shipped');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (17, 4, 8, '2024-01-18', 2, 'Delivered');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (18, 4, 3, '2024-08-10', 6, 'Pending');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (19, 1, 9, '2023-11-17', 6, 'Shipped');
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `order_date`, `quantity`, `order_status`) VALUES (20, 2, 2, '2024-08-25', 2, 'Shipped');
After you import the data, associate the data tables in the Xiyan console.
Step 2: Verify the Q&A feature in the console
