Knowledge

Information schema

Source 📝

92:=> SELECT count(table_name) FROM information_schema.tables; count ------- 99 (1 row) => SELECT column_name, data_type, column_default, is_nullable FROM information_schema.columns WHERE table_name='alpha'; column_name | data_type | column_default | is_nullable -------------+-----------+----------------+------------- foo | integer | | YES bar | character | | YES (2 rows) => SELECT * FROM information_schema.information_schema_catalog_name; catalog_name -------------- johnd (1 row) 466: 399:
Metadata that applies primarily to the runtime database environment is managed through the INFORMATION_SCHEMA. Metadata that applies to the information system environment as a whole is managed through the dictionary or
536: 507: 48:
in a database. It can be used as a source of the information that some databases make available through non-standard commands, such as:
386: 531: 500: 344: 100:
As a notable exception among major database systems, Oracle does not as of 2015 implement the information schema. An
339: 260: 220: 185: 180: 309: 541: 493: 121: 17: 377:. The Morgan Kaufmann series in data management systems, ISSN 1046-1698. Morgan Kaufmann. p.  526: 304: 349: 382: 378: 369:
Melton, Jim; Simon, Alan R. (1993). "19.2 Metadata, Repositories and The INFORMATION_SCHEMA".
235: 41: 299: 465: 225: 45: 33: 412: 287: 245: 111: 67: 37: 334: 319: 477: 131: 520: 371: 215: 329: 324: 265: 230: 210: 101: 200: 164: 116: 436: 314: 195: 141: 85: 81: 175: 170: 146: 32:-standard set of read-only views that provide information about all of the 473: 270: 250: 71: 275: 240: 190: 159: 126: 255: 151: 136: 57: 29: 481: 206:
RDBMSs that do not support information_schema include:
325:
Information schema in Microsoft SQL Server Compact 4.0
370: 310:Information schema in PostgreSQL (current version) 330:Oracle Information Schema project on sourceforge 107:RDBMSs that support information_schema include: 537:American National Standards Institute standards 320:Information schema in Microsoft SQL Server 2014 501: 8: 373:Understanding the New SQL: A Complete Guide 508: 494: 437:"Pragma statements supported by SQLite" 361: 7: 462: 460: 14: 350:Information Schema in CockroachDB 300:Information schema in H2 Database 88:'s default command-line program). 464: 305:Information schema in MySQL 9.0 413:"Snowflake Information Schema" 1: 345:Information Schema in CrateDB 340:Information Schema in MonetDB 335:Information Schema in MariaDB 480:. You can help Knowledge by 315:Information schema in SQLite 558: 459: 104:exists to address this. 476:-related article is a 122:Microsoft SQL Server 18:relational databases 266:Sybase SQL Anywhere 102:open-source project 532:Computer standards 156:InterSystems Caché 26:information_schema 22:information schema 489: 488: 417:www.snowflake.com 167:(formerly MemSQL) 549: 510: 503: 496: 468: 461: 451: 450: 448: 447: 433: 427: 426: 424: 423: 409: 403: 402: 396: 395: 376: 366: 226:Microsoft Access 79: 65: 55: 27: 557: 556: 552: 551: 550: 548: 547: 546: 517: 516: 515: 514: 457: 455: 454: 445: 443: 435: 434: 430: 421: 419: 411: 410: 406: 393: 391: 389: 368: 367: 363: 358: 296: 288:Oracle metadata 284: 246:Oracle Database 112:Amazon Redshift 98: 93: 77: 63: 53: 25: 12: 11: 5: 555: 553: 545: 544: 542:Database stubs 539: 534: 529: 519: 518: 513: 512: 505: 498: 490: 487: 486: 469: 453: 452: 441:www.sqlite.org 428: 404: 387: 360: 359: 357: 354: 353: 352: 347: 342: 337: 332: 327: 322: 317: 312: 307: 302: 295: 294:External links 292: 291: 290: 283: 280: 279: 278: 273: 268: 263: 258: 253: 248: 243: 238: 233: 228: 223: 218: 213: 204: 203: 198: 193: 188: 183: 178: 173: 168: 162: 157: 154: 149: 144: 139: 134: 129: 124: 119: 114: 97: 96:Implementation 94: 91: 90: 89: 74: 60: 13: 10: 9: 6: 4: 3: 2: 554: 543: 540: 538: 535: 533: 530: 528: 525: 524: 522: 511: 506: 504: 499: 497: 492: 491: 485: 483: 479: 475: 470: 467: 463: 458: 442: 438: 432: 429: 418: 414: 408: 405: 401: 390: 388:9781558602458 384: 380: 375: 374: 365: 362: 355: 351: 348: 346: 343: 341: 338: 336: 333: 331: 328: 326: 323: 321: 318: 316: 313: 311: 308: 306: 303: 301: 298: 297: 293: 289: 286: 285: 281: 277: 274: 272: 269: 267: 264: 262: 259: 257: 254: 252: 249: 247: 244: 242: 239: 237: 234: 232: 229: 227: 224: 222: 219: 217: 216:Apache Ignite 214: 212: 209: 208: 207: 202: 199: 197: 194: 192: 189: 187: 184: 182: 179: 177: 174: 172: 169: 166: 163: 161: 158: 155: 153: 150: 148: 145: 143: 140: 138: 135: 133: 130: 128: 125: 123: 120: 118: 115: 113: 110: 109: 108: 105: 103: 95: 87: 83: 75: 73: 69: 61: 59: 51: 50: 49: 47: 43: 39: 35: 31: 23: 19: 482:expanding it 471: 456: 444:. Retrieved 440: 431: 420:. Retrieved 416: 407: 398: 392:. Retrieved 372: 364: 231:IBM Informix 211:Apache Derby 205: 106: 99: 21: 15: 400:repository. 201:CockroachDB 165:SingleStore 147:H2 Database 117:Apache Hive 80:command in 66:command of 56:command of 521:Categories 446:2022-02-01 422:2024-03-25 394:2015-10-22 356:References 261:Sybase ASE 196:ClickHouse 142:PostgreSQL 86:PostgreSQL 46:procedures 527:Databases 176:Snowflake 171:Mimer SQL 132:Snowflake 474:database 282:See also 271:Teradata 251:SAP HANA 221:Firebird 72:SQL*Plus 64:DESCRIBE 28:) is an 276:Vertica 241:IBM Db2 191:CrateDB 160:MariaDB 127:MonetDB 42:columns 385:  256:SQLite 236:Ingres 186:Presto 152:HSQLDB 68:Oracle 44:, and 34:tables 20:, the 472:This 181:Trino 137:MySQL 58:MySQL 38:views 478:stub 383:ISBN 82:psql 76:the 62:the 54:SHOW 52:the 30:ANSI 379:371 70:'s 16:In 523:: 439:. 415:. 397:. 381:. 78:\d 40:, 36:, 509:e 502:t 495:v 484:. 449:. 425:. 84:( 24:(

Index

relational databases
ANSI
tables
views
columns
procedures
MySQL
Oracle
SQL*Plus
psql
PostgreSQL
open-source project
Amazon Redshift
Apache Hive
Microsoft SQL Server
MonetDB
Snowflake
MySQL
PostgreSQL
H2 Database
HSQLDB
MariaDB
SingleStore
Mimer SQL
Snowflake
Trino
Presto
CrateDB
ClickHouse
CockroachDB

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.