命令

show create table game;

game是表名 

在web管理中,请在sql标签中查,不要在query中执行.

show create table game;
=== <Result of SELECT Command in Line 1> ===
  TABLE                 CREATE TABLE        
============================================
  'game'                'CREATE TABLE game (
host_year INTEGER NOT NULL, event_code INTEGER NOT NULL, athlete_code INTEGER NOT NULL, 
stadium_code INTEGER NOT NULL, nation_code CHARACTER(3), medal CHARACTER(1), game_date DATE,  
CONSTRAINT pk_game_host_year_event_code_athlete_code PRIMARY KEY  (host_year, event_code, athlete_code),  
CONSTRAINT fk_game_event_code FOREIGN KEY  (event_code) REFERENCES event ON DELETE RESTRICT ON UPDATE RESTRICT,  
CONSTRAINT fk_game_athlete_code FOREIGN KEY  (athlete_code) REFERENCES athlete ON DELETE RESTRICT ON UPDATE RESTRICT)'
1 row selected.
Current transaction has been committed.
1 command(s) successfully processed.

可以看到外键信息如
CONSTRAINT fk_game_event_code FOREIGN KEY  (event_code) REFERENCES event ON DELETE RESTRICT ON UPDATE RESTRICT,  


可以看到主键信息
CONSTRAINT pk_game_host_year_event_code_athlete_code PRIMARY KEY  (host_year, event_code, athlete_code),  

换个体位看索引 ,利用主键
SELECT * FROM db_index WHERE class_name = 'game' AND is_primary_key = 'YES';

CUBRID学习笔记 21 查看主键外键索引

 

 

CUBRID学习笔记 21 查看主键外键索引
















相关文章:

  • 2021-04-11
  • 2021-08-09
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2021-05-09
  • 2021-08-11
猜你喜欢
  • 2022-02-15
  • 2022-12-23
  • 2021-12-28
  • 2022-01-05
  • 2021-11-30
  • 2021-06-19
  • 2021-11-26
相关资源
相似解决方案