일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- Elastic
- ann
- Analyzer
- TSLA
- mysql
- NORI
- 아이온큐
- dbeaver
- Aggregation
- Selenium
- file download
- Docker
- java
- KNN
- JPA
- elasticsearch cache
- vavr
- 양자컴퓨터
- java crawler
- IONQ
- Elasticsearch
- redis
- request cache
- Cache
- 테슬라
- aqqle
- Query
- API
- aggs
- api cache
Archives
- Today
- Total
아빠는 개발자
Database 본문
728x90
반응형
내 투자회사의 첫 DB
-- 국내 투자 정보
CREATE TABLE `investment` (
`id` bigint NOT NULL AUTO_INCREMENT,
`company` varchar(200) NOT NULL,
`exchange` varchar(200) NOT NULL,
`type` varchar(20) NOT NULL,
`price` bigint NOT NULL default 0,
`quantity` bigint NOT NULL default 0,
`use_yn` enum('Y','N') NOT NULL DEFAULT 'Y',
`created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `company_index` (`company`,`exchange` )
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- 해외 투자 crawler
CREATE TABLE `stock` (
`id` bigint NOT NULL AUTO_INCREMENT,
`company` varchar(100) NOT NULL,
`company_code` varchar(20) NOT NULL,
`exchange` varchar(30) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`use_yn` enum('Y','N') NOT NULL DEFAULT 'Y',
`created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `company_code_index` (`company_code` )
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
728x90
반응형
'Investment' 카테고리의 다른 글
[CRAWLER] Data 수집 - yahoo finance (2) | 2024.06.01 |
---|