You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RuoYi-Vue/sql_ok/t_stock_basic.sql

41 lines
2.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
Navicat Premium Dump SQL
Source Server : 192.168.0.222
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 192.168.0.222:3306
Source Schema : ry_refactor0120
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 24/01/2026 10:59:56
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_stock_basic
-- ----------------------------
DROP TABLE IF EXISTS `t_stock_basic`;
CREATE TABLE `t_stock_basic` (
`stock_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '证券代码如000061.SZ、600000.SH',
`stock_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '证券名称(如“农 产 品”)',
`listing_date` date NULL DEFAULT NULL COMMENT '首发上市日期',
`listing_days` int NULL DEFAULT NULL COMMENT '上市天数(冗余存储,提升查询效率)',
`is_st` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否为ST股票1=是0=否)',
`is_star_st` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否为*ST股票1=是0=否)',
`industry_index_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '所属行业指数代码关联t_industry_index',
`industry_index_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '所属行业指数名称(冗余存储,减少关联查询)',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间',
PRIMARY KEY (`stock_code`) USING BTREE,
INDEX `idx_t_stock_basic_industry`(`industry_index_code` ASC) USING BTREE,
CONSTRAINT `t_stock_basic_ibfk_1` FOREIGN KEY (`industry_index_code`) REFERENCES `t_industry_basic` (`industry_code`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'A股个股基础信息' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;