Query goal: | Find the number and percentage of optinal columns in base tables |
Query type: | Sofware measure (Numeric values (software measures) about the database) |
Query license: | MIT License |
Data source: | INFORMATION_SCHEMA only |
SQL query: | Click on query to copy it
SELECT Count(*) FILTER (WHERE C.is_nullable='YES') AS number_of_optional_columns, Count(*) AS number_of_columns, Round(Count(*) FILTER (WHERE C.is_nullable='YES')::decimal*100/Count(*)::decimal,1) AS percentage_of_optional_columns FROM information_schema.columns C INNER JOIN information_schema.tables T USING (table_schema, table_name) INNER JOIN information_schema.schemata S ON T.table_schema = S.schema_name WHERE T.table_type = 'BASE TABLE' AND (T.table_schema = 'public' OR S.schema_owner<>'postgres'); |
Collection name | Collection description |
---|---|
Find problems about integrity constraints | A selection of queries that return information about the state of integrity constraints in the datadabase. Contains all the types of queries - problem detection, software measure, and general overview |
Find problems by overview | Queries that results point to different aspects of database that might have problems. A human reviewer has to decide based on the results as to whether there are problems or not . |
Find quick numeric overview of the database | Queries that return numeric values showing mostly the number of different types of database objects in the database |
Category name | Category description |
---|---|
Missing data | Queries of this category provide information about missing data (NULLs) in a database. |