Database Catalog and Metadata Quiz

CapableAmethyst avatar
CapableAmethyst
·
·
Download

Start Quiz

Study Flashcards

70 Questions

What is the primary function of a database management system (DBMS)?

Storing similar data in a standardized manner

In what ways can data vary?

In the amount produced and collected, format, and access

What does the scope of data refer to?

The amount of data produced and collected

What is the primary function of authorization in a database system?

Restricting access to specific tables, columns, or rows for individual users

Why is performance crucial in a database system?

Response time degrades with numerous users and applications

What is the role of the transaction manager in a database system?

Ensuring transactions are properly executed and restoring the database to a consistent state after a failure

Which type of databases are optimized for handling large, unstructured data?

NoSQL databases

What are the common queries used to manipulate and access data in a database?

CRUD operations (Create, Read, Update, Delete)

What phase of the database design specifies database requirements as entities, relationships, and attributes?

Analysis phase

What is the purpose of an application programming interface (API) in database programming?

To link a host programming language to a database and handle details such as connecting to the database and executing queries

What is the purpose of MySQL Workbench in interacting with MySQL Server?

To interact with MySQL Server via a graphical user interface and execute SQL commands using an editor

What does data independence allow database designers to do?

Tune query performance without changes to application programs

What is the standard relational query language mentioned in the text?

SQL

What does the MySQL Command-Line Client allow developers to do?

Connect to the database server, perform administrative functions, and execute SQL statements

What is the term occasionally used instead of data independence?

Information independence

What is the primary data structure of the Relational Model database?

Relational

Which database system is known for its integration with object-oriented programming languages?

Neo4j

What is the relational data structure based on?

Set theory

Which SQL statement is used to delete an existing table along with all its rows?

DROP TABLE

What category do character data types fall into in relational databases?

Textual

Which SQL operator is used to compute logical values by comparing operands?

Comparison

Which SQL sublanguage is used for defining the structure of the database?

Data Definition Language (DDL)

What is the term used to refer to a single executing copy of a database system that may contain multiple system and user databases?

Database Instance

Which statement is used to modify existing rows in a table?

UPDATE

What is the purpose of the PRIMARY KEY constraint in a table?

To identify a row and ensure uniqueness

Which special value represents unknown or inapplicable data in a database?

NULL

What action can lead to errors when inserting primary keys?

Inserting values for auto-increment primary keys

What is the purpose of a foreign key constraint in a CREATE TABLE statement?

To ensure referential integrity by rejecting statements that violate it

How are constraints added and dropped in a database using the ALTER TABLE statement?

By using the ADD, DROP, or CHANGE clause

Which operator is used in a WHERE clause to determine if a value matches one of several values?

IN

What does the BETWEEN operator provide an alternative way to determine?

If a value is between two other values

In a self-join, what are aliases necessary for?

Distinguishing left and right tables

What does a correlated subquery reference in the outer query?

A column from the outer query

What does a cross-join combine without comparing columns?

Two tables

Where is a subquery typically used?

In a SELECT statement's WHERE clause

Which SQL clause is used in a cross-join to combine two tables without comparing columns?

CROSS JOIN

What is the purpose of an alias in SQL?

To create a temporary name for a column or table

When does the EXISTS operator in SQL return TRUE?

When at least one row is selected by the subquery

What is the purpose of the WITH CHECK OPTION clause in databases that support view updates?

To prevent inserts and updates that do not satisfy the view query conditions

What is the main purpose of materialized views in databases?

To store the view data, requiring regular refreshes when base tables change

In an entity-relationship model, what is an attribute?

A descriptive property of an entity

What is the primary purpose of an entity-relationship diagram (ER diagram)?

To provide a schematic picture of entities, relationships, and attributes

When implemented in SQL, what do entities typically become?

Tables

What is the term for the greatest and least number of instances of related entities in a relationship?

Cardinality

What are weak entities in a database design?

Entities that rely on another entity for identity

In ER diagram conventions, what is indicated by a '1' and describes at most one entity instance?

Unique attribute

What is the primary purpose of normalization in table design?

To reflect business rules and eliminate redundancy

Which normal form requires all non-key columns to depend on the whole primary key?

Second normal form (2NF)

What is the key characteristic of a table in Boyce-Codd normal form (BCNF)?

It ensures that every dependency is on a unique column

In Entity-Relationship modeling, what do relationship types represent?

Sets of related things

What is the primary function of the analysis phase in database design?

Capture data requirements while ignoring implementation details

What does cardinality refer to in Entity-Relationship modeling?

Maxima and minima of relationships and attributes

In database design, what is the primary key rule for tables in a relational database?

Must be unique and meaningful

What is the purpose of the WITH CHECK OPTION clause in databases that support view updates?

To enforce constraints on data updates

What is the primary function of authorization in a database system?

To control access to the database objects and operations

In row-oriented storage, why does it perform best when the row size is small relative to block size?

It minimizes the number of blocks transferred for queries involving multiple rows.

Why is column-oriented storage considered optimal for analytic applications?

It minimizes the number of columns read from each row.

What is the role of controllers in managing storage media in databases and file systems?

To convert between blocks and sectors or pages.

Which index is also known as a clustering index?

Primary index

What type of multi-level index is referred to as a B-tree?

Unbalanced multi-level index

What type of indexes store index entries in buckets and allocate new blocks as needed?

Hash indexes

What is a characteristic of column-oriented storage that makes it less suitable for transactional applications?

Reading or writing an entire row requires accessing multiple blocks

What is the primary drawback of a hash table when the number of rows grows?

Its performance can degrade as the number of rows grows

What influences the decision between a table scan and an index scan in executing a query?

The percentage of table rows selected by a query

Which statement describes the primary function of a storage engine or storage manager in a database system?

It translates instructions generated by a query processor into low-level commands that access data on storage media.

What is the main purpose of the EXPLAIN statement in a database system?

To generate a result table that describes how a statement is executed by the storage engine.

What is the key characteristic of a range partition in database table partitioning?

It specifies the upper bound of each range using the VALUES LESS THAN keywords.

What is the main role of shards in a distributed database?

To store table data subsets on different computers of a distributed database.

What is the primary function of the MySQL Command-Line Client in interacting with MySQL Server?

To allow developers to view and manage databases using a command-line interface.

What does the physical design process in MySQL with InnoDB involve?

Creating initial physical design, identifying slow queries, running EXPLAIN on each slow query, and creating and dropping indexes based on the EXPLAIN result table.

Study Notes

  • The catalog, also known as a data dictionary, is a directory of database objects including tables, columns, indexes, and other components.

  • Leading database systems are predominantly relational, storing data in tables, columns, and rows.

  • SQL is the query language for relational databases, used for data manipulation and querying.

  • Relational databases are suitable for databases requiring accurate transaction records.

  • The rise of big data and the internet in the late 1990s led to the emergence of non-relational databases (NoSQL) optimized for handling large, unstructured data.

  • Open-source software licensing has become a popular alternative to commercial database systems since 2000.

  • Common queries include CRUD operations (Create, Read, Update, and Delete) and are used to manipulate and access data.

  • SQL query language includes statements for data manipulation and database administration.

  • Database design process includes three phases: analysis, logical design, and physical design.

  • Analysis phase specifies database requirements, represented as entities, relationships, and attributes.

  • Logical design implements database requirements in a specific database system, converting entities, relationships, and attributes into tables, keys, and columns.

  • Physical design adds indexes and optimizes table storage, affecting query processing speed.

  • Relational database design includes logical and physical design, with logical design affecting query results and physical design affecting query processing speed.

  • Auto-increment columns: assigned automatically incrementing values when new rows are inserted, defined using the AUTO_INCREMENT keyword in a CREATE TABLE statement.

  • Errors when inserting primary keys: inserting values for auto-increment primary keys or omitting values for non-auto-increment primary keys.

  • MySQL allows insertion of a specific value to an auto-increment column, but this may lead to errors in managing primary keys.

  • Foreign keys: refer to a primary key and have the same data type but may have different names. They obey the rule of referential integrity which requires foreign key values to match primary key values or be NULL.

  • Multiple foreign keys may refer to the same primary key and a foreign key can refer to a primary key in the same table.

  • Foreign key constraint: added to a CREATE TABLE statement using the FOREIGN KEY and REFERENCES keywords, it ensures referential integrity by rejecting statements that violate it.

  • Referential integrity: a relational rule requiring foreign key values to either be fully NULL or match some primary key value.

  • Referential integrity can be violated in four ways: primary key update, foreign key update, primary key deletion, or foreign key insertion.

  • Automatic correction of referential integrity violations: databases can automatically correct violations using actions such as RESTRICT, SET NULL, SET DEFAULT, or CASCADE.

  • ON UPDATE and ON DELETE clauses: specify actions to be taken when the referenced primary key is updated or deleted.

  • Primary key updates and deletes: MySQL supports constraints for these actions, but there are limitations depending on the configuration.

  • Column and table constraints: rules that govern allowable values in a database, implemented using special keywords in a CREATE TABLE statement.

  • UNIQUE constraint: ensures values in a column or group of columns are unique and can be applied as a column or table constraint.

  • CHECK constraint: specifies an expression on one or more columns and is violated when the expression is FALSE and satisfied when it is TRUE or NULL.

  • Constraints are added and dropped using the ALTER TABLE statement followed by an ADD, DROP, or CHANGE clause.

  • An alias is a temporary name assigned to a column or table using the AS keyword.

  • The EXISTS operator is used in correlated subqueries and returns TRUE if a subquery selects at least one row and FALSE if no rows are selected.

  • Subqueries can be rewritten as joins for better performance, a process called flattening a query.

  • View tables are created to improve table design for users by restructuring columns and data types without altering the underlying database design.

  • View tables do not store data; instead, they merge the view query with an SQL query, and the database executes the merged query against base tables.

  • Materialized views store the view data, requiring regular refreshes when base tables change.

  • Views offer several advantages, such as data security by hiding sensitive information, saving complex queries, and optimizing performance.

  • Inserting, updating, and deleting data in views is problematic due to primary keys, aggregate values, and join views.

  • The WITH CHECK OPTION clause in databases that support view updates prevents inserts and updates that do not satisfy the view query conditions.

  • Relational algebra is a mathematical approach to manipulating data in databases, with nine operations represented by Greek letter symbols.

  • Each relational algebra operation corresponds to an SQL query and defines a single result table.

  • The operations include Select (Sigma), Project (Pi), Product (multiplication), Join (⋈), Union (∪), Intersect (∩), Difference (-), Rename (ρ), and Aggregate (γ).

  • Model complex systems into subject areas with entities, where strong entities are independent and weak entities are dependent.

  • UML and IDEF1X are popular modeling conventions for software development and database design respectively.

  • Intangible entities are documented in data models but not tracked with data in databases, distinguished with special notation.

  • In the logical design phase, entities become tables and attributes become columns, primary keys are selected.

  • Primary keys should be unique, non-NULL, stable, simple, and meaningless for efficient database management.

  • Strong entities become strong tables, with stable, simple, and meaningless primary keys, either single-column or composite.

  • Subtype entities become subtype tables, implementing IsA relationship with identical primary keys and referential integrity actions.

  • One-one relationships become foreign keys, placed in the table with fewer rows to minimize NULL values.

  • Many-many relationships become new weak tables, containing composite primary keys and identified by related tables.

  • Implementing relationships results in foreign keys or new tables, with referential integrity actions for cascade and restrict.

  • Database design involves adding foreign keys to initial table design, converting many-one, one-one, and many-many relationships.

  • Plural attributes move to new weak tables, containing primary keys and foreign keys, and their primary keys are composite.

  • Column-oriented storage stores values for a single column in each block

  • Column-oriented storage benefits analytic applications due to faster data access and better data compression

  • In column-oriented storage, reading or writing an entire row requires accessing multiple blocks, making it less suitable for transactional applications

  • Heap table is a table structure in which rows are not ordered and are stored in the order they are inserted

  • Heap tables optimize insert operations, especially for bulk loads, but are not optimal for queries that read rows in a specific order

  • Sorted table is a table structure where rows are ordered according to a sort column and are stored in blocks based on the value of the sort column

  • Sorted tables are optimized for queries that read data in order of the sort column but are not optimal for insert or update operations

  • Hash table is a table structure where rows are assigned to buckets based on a hash function and a hash key

  • Hash tables distribute rows evenly across blocks, making them suitable for queries that require random access to rows, but their performance can degrade when the number of rows grows

  • Table clusters, also called multi-tables, interleave rows of two or more tables in the same storage area, making them less suitable for most queries and not commonly used.

  • A single-level index is a file containing column values and pointers to the rows containing the column value

  • Indexes can be created on a single column or multiple columns, and the database can use either a table scan or an index scan to execute a query

  • Hit ratio, or the percentage of table rows selected by a query, influences the decision between a table scan and an index scan. A high hit ratio indicates a table scan is more efficient, while a low hit ratio indicates an index scan is more efficient.

Test your knowledge about database catalogs, metadata, and relational databases with this quiz. Learn about the directory of tables, columns, indexes, and other database objects, as well as the importance of metadata in database management.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser