Advertisement
Fhernd

script.sql

Sep 5th, 2014
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT ATC.TABLE_NAME Tabla, COUNT(DISTINCT ATC.COLUMN_NAME) NUM_Columnas, COUNT(DISTINCT AC.CONSTRAINT_TYPE), MAX(AT.NUM_ROWS) NUM_TUPLAS
  2. FROM ALL_TAB_COLS ATC, ALL_CONSTRAINTS AC, ALL_TABLES AT
  3. WHERE SUBSTR(ATC.TABLE_NAME, 1, 1) BETWEEN 'A' AND 'K'
  4. AND ATC.TABLE_NAME IN ('BARES', 'BEBEDORES', 'BEBIDAS', 'FRECUENTAN', 'FRECUENTAN', 'GUSTAN', 'SIRVEN', 'TIPO_BEBIDA')
  5. AND ATC.TABLE_NAME = AC.TABLE_NAME
  6. AND AT.TABLE_NAME = AC.TABLE_NAME
  7. AND AC.CONSTRAINT_TYPE = 'P' GROUP BY ATC.TABLE_NAME;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement