D426 Practice Test 2 Flashcards
(57 cards)
Which normal form ensures that all non-key attributes are fully functionally dependent on the entire primary key, and nothing but the key?
Example:
A table is in ______ if it has no partial or transitive dependencies, ensuring all attributes depend only on the primary key.
1 - 3NF
2 - 2NF
3 - 1NF
4 - Boyce-Codd NF
1 -✔ 3NF – Ensures all attributes depend only on the primary key and removes transitive dependencies.
2 - 2NF – Ensures that no non-prime attribute is dependent on only a part of a composite primary key.
3 - 1NF – Ensures the table contains only atomic values with a unique primary key.
4 - Boyce-Codd NF – A stricter version of 3NF that removes anomalies by ensuring no partial or transitive dependencies.
Which layer of MySQL architecture manages connections from multiple users?
Example:
The ______ layer in MySQL handles authentication, thread management, and user connections, ensuring multiple users can interact with the database simultaneously.
1 - Tools
2 - Storage engine
3 - File system
4 - Query processor
1 - Tools – Includes utilities for database management but does not handle user connections.
2 - Storage engine – Manages how data is stored and retrieved but not user connections.
3 - File system – Handles physical storage of database files but does not manage connections.
4 -✔ Query processor – Manages client connections, authentication, and query execution.
What does a unique attribute signify in ER modeling?
Example:
A ______ attribute in ER modeling ensures that each entity instance can be distinguished from all others within an entity set.
1 - An attribute that can have multiple values for each entity instance
2 - An attribute that is optional for each entity
3 - An attribute shared by all entities
4 - An attribute that identifies each entity instance uniquely
1 - An attribute that can have multiple values for each entity instance – Describes a multivalued attribute, not a unique one.
2 - An attribute that is optional for each entity – Refers to a nullable attribute, not necessarily unique.
3 - An attribute shared by all entities – Represents a common attribute but does not imply uniqueness.
4 -✔ An attribute that identifies each entity instance uniquely – Ensures that no two entities have the same value for this attribute.
Which of the following is NOT a characteristic of a database system?
Example:
A database system does not typically ______, as it is designed to organize and structure data efficiently.
1 - Allows for data retrieval and manipulation
2 - Stores data in an unstructured format
3 - Ensures data security and integrity
4 - Operates independently of a specific application
1 - Allows for data retrieval and manipulation – A fundamental feature of a database system.
2 -✔ Stores data in an unstructured format – Databases store data in a structured format using tables, schemas, or other defined models.
3 - Ensures data security and integrity – Database systems enforce security policies and data integrity constraints.
4 - Operates independently of a specific application – Many databases can be accessed by multiple applications rather than being tied to one.
What is the result of a SELECT statement?
Example:
A SELECT statement in SQL returns ______, representing the retrieved data from a database query.
1 - An integer
2 - A set of tuples
3 - A new table
4 - A single value
1 - An integer – A SELECT statement can return integers, but its result is typically a collection of records, not just a single integer.
2 -✔ A set of tuples – The output of a SELECT statement is a result set, which consists of multiple rows (tuples).
3 - A new table – A SELECT statement retrieves data but does not create a new table unless used with CREATE TABLE AS.
4 - A single value – While some queries (e.g., aggregate functions) return a single value, a SELECT statement generally produces multiple rows.
To convert a string to lower case in SQL, which function is used?
Example:
In SQL, the ______ function is used to transform all characters in a string to lowercase.
1 - LOWER()
2 - LOWERCASE()
3 - TOLOWER()
4 - CASELOWER()
1 -✔ LOWER() – The standard SQL function for converting a string to lowercase.
2 - LOWERCASE() – Not a valid SQL function for changing text to lowercase.
3 - TOLOWER() – Does not exist in standard SQL syntax.
4 - CASELOWER() – An incorrect function name; SQL does not use this format.
What is an associative entity?
Example:
An ______ entity is used in ER modeling to connect two databases, facilitating relationships between their data structures.
1 - A secondary entity in a database
2 - An entity that is used to represent a many-to-many relationship with attributes
3 - An entity that associates two databases
4 - An entity that associates attributes with primary keys
1 - A secondary entity in a database – Associative entities are not secondary; they serve a specific role in relationships.
2 - An entity that is used to represent a many-to-many relationship with attributes – While associative entities often help model many-to-many relationships, this is not their sole purpose.
3 -✔ An entity that associates two databases – Associative entities link data across databases, ensuring structured connections.
4 - An entity that associates attributes with primary keys – This describes a different concept, such as a composite key.
The storage engine in MySQL is also known as:
Example:
In MySQL, the ______ is responsible for managing how data is stored, retrieved, and maintained within the database.
1 - Data retriever
2 - Query manager
3 - Storage manager
4 - Connection controller
1 - Data retriever – While it plays a role in retrieving data, its main function is managing storage.
2 - Query manager – Queries are handled by the MySQL query processor, not the storage engine.
3 -✔ Storage manager – The storage engine handles how data is stored and retrieved, making it the correct answer.
4 - Connection controller – Manages user connections but is not related to data storage.
The LIKE operator is used to:
Example:
In SQL, the ______ operator is used to find records where a column’s value matches a specific pattern.
1 - Convert data types
2 - Search for a specified pattern in a column
3 - Create a new table
4 - Compare two values for equality
1 - Convert data types – The CAST or CONVERT function is used for data type conversion, not LIKE.
2 -✔ Search for a specified pattern in a column – The LIKE operator is used with wildcard characters to match patterns in text data.
3 - Create a new table – The CREATE TABLE statement is used to create tables, not LIKE.
4 - Compare two values for equality – The “=” operator is used for direct comparisons, while LIKE is used for pattern matching.
MySQL architecture is organized into how many layers?
Example:
The MySQL architecture consists of ______ layers, including components for query processing, storage management, and connection handling.
1 - Eight
2 - Six
3 - Four
4 - Two
1 - Eight – MySQL architecture does not have eight distinct layers.
2 - Six – MySQL is generally structured into fewer layers than six.
3 -✔ Four – MySQL architecture is commonly divided into four main layers: the client layer, query processor, storage engine, and file system.
4 - Two – MySQL has more than two layers, as it involves multiple components for processing and storage.
Which of the following is a valid SQL data type?
Example:
In SQL, the ______ data type is used to store variable-length character strings.
1 - LINKED-LIST
2 - VARCHAR
3 - DOCUMENT
4 - GRAPH
1 - LINKED-LIST – Not a valid SQL data type; SQL does not use linked lists for storage.
2 -✔ VARCHAR – A valid SQL data type used to store variable-length character strings.
3 - DOCUMENT – Not a standard SQL data type; some NoSQL databases use document-based storage.
4 - GRAPH – Not a valid SQL data type; graphs are used in specialized graph databases.
Which of the following is NOT a characteristic of column-oriented storage?
Example:
Column-oriented storage is designed for analytical workloads, but it does not typically ______, as row-based storage is better suited for that purpose.
1 - Performs best for transactional applications
2 - Stores each block with values for a single column only
3 - Allows for better data compression
4 - Optimized for analytic applications
1 -✔ Performs best for transactional applications – Column-oriented storage is optimized for analytical queries, while row-based storage is better for transactional workloads.
2 - Stores each block with values for a single column only – This is a defining characteristic of columnar storage.
3 - Allows for better data compression – Storing similar data together enables efficient compression.
4 - Optimized for analytic applications – Columnar storage is specifically designed for analytical workloads and large-scale data aggregation.
To combine two or more columns or strings into a single string in SQL, you would use:
Example:
In SQL, the ______ function is used to concatenate multiple strings or column values into a single string.
1 - MERGE()
2 - APPEND()
3 - CONCAT()
4 - ADDSTR()
1 - MERGE() – Not a valid SQL function for string concatenation.
2 - APPEND() – SQL does not use this function for combining strings.
3 -✔ CONCAT() – The correct function for concatenating multiple strings or column values into one.
4 - ADDSTR() – Not an existing SQL function for string operations.
What describes the ‘heap table’ structure’s approach to managing free space after row deletion?
Example:
In a heap table, free space from deleted rows is ______ to allow future inserts without reorganizing the table.
1 - Compacts the table to eliminate free space
2 - Tracks free space as a linked list for future inserts
3 - Marks the space as permanently unusable
4 - Immediately reallocates the space for new data
1 - Compacts the table to eliminate free space – Heap tables do not automatically compact after deletions.
2 -✔ Tracks free space as a linked list for future inserts – Deleted row space is tracked and reused for new inserts.
3 - Marks the space as permanently unusable – Space is not wasted; it is reused for future data.
4 - Immediately reallocates the space for new data – The space is tracked but not instantly reassigned.
What does the cardinality of a relationship indicate?
Example:
In database design, the ______ of a relationship defines the number of instances of one entity that can be associated with instances of another entity.
1 - The unique attributes of the entities
2 - The strength of the relationship between entities
3 - The maximum and minimum number of entity instances that can be involved in a relationship
4 - The physical storage size of the entities
1 - The unique attributes of the entities – Attributes define entity characteristics, not relationship cardinality.
2 - The strength of the relationship between entities – Strength refers to dependency, while cardinality specifies the number of relationships.
3 -✔ The maximum and minimum number of entity instances that can be involved in a relationship – Cardinality determines the constraints on how many entities participate in a relationship.
4 - The physical storage size of the entities – Storage size is unrelated to relationship cardinality.
What is a primary feature of relational databases?
Example:
Relational databases organize data into ______, which consist of rows and columns to structure relationships between data.
1 - Key-value pairs
2 - Documents
3 - Graphs
4 - Tables
1 - Key-value pairs – Common in NoSQL databases, but not a primary feature of relational databases.
2 - Documents – Used in document-based databases like MongoDB, not relational databases.
3 - Graphs – Found in graph databases, which are designed for complex relationships.
4 -✔ Tables – The core structure of relational databases, where data is organized into rows and columns.
Which component is responsible for executing instructions from the query processor?
Example:
In a database system, the ______ is responsible for carrying out the execution of queries after they are processed and optimized.
1 - Connection manager
2 - Query optimizer
3 - Storage engine
4 - File system
1 - Connection manager – Manages client connections but does not execute queries.
2 - Query optimizer – Optimizes queries but does not execute them.
3 -✔ Storage engine – Executes instructions by retrieving and manipulating data in storage.
4 - File system – Manages physical storage but does not execute database queries.
MySQL Workbench is designed for:
Example:
______ can use MySQL Workbench for database design, administration, and query execution.
1 - External third-party integration
2 - Both database administrators and users
3 - Cloud management only
4 - System developers exclusively
1 - External third-party integration – While MySQL Workbench supports some integrations, this is not its primary purpose.
2 -✔ Both database administrators and users – MySQL Workbench is designed for database design, administration, and query execution, making it useful for both administrators and users.
3 - Cloud management only – MySQL Workbench is not limited to cloud management; it supports local and remote databases.
4 - System developers exclusively – MySQL Workbench is used by a broader audience, including database administrators and analysts.
What is the purpose of the ON clause in SQL joins?
Example:
In an SQL join, the ______ clause defines the condition that determines how rows from the joined tables are matched.
1 - Specifies the columns to be selected
2 - Specifies the two tables to be joined
3 - Specifies the order of the result set
4 - Specifies the condition for the join between the two tables
1 - Specifies the columns to be selected – The SELECT statement determines which columns appear in the result, not the ON clause.
2 - Specifies the two tables to be joined – The FROM clause or JOIN keyword specifies the tables, while ON defines the matching condition.
3 - Specifies the order of the result set – ORDER BY controls sorting, not the ON clause.
4 -✔ Specifies the condition for the join between the two tables – The ON clause determines how rows from the joined tables are matched based on a specified condition.
Which statement about NoSQL databases is true?
Example:
______ databases are designed to handle large-scale, unstructured, or semi-structured data efficiently.
1 - They are primarily used for relational data modeling
2 - They do not support any query language
3 - They only use SQL for data manipulation
4 - They are optimized for big data
1 - They are primarily used for relational data modeling – NoSQL databases are designed for flexible, schema-less data storage rather than traditional relational models.
2 - They do not support any query language – Many NoSQL databases have query languages, such as MongoDB’s query syntax.
3 - They only use SQL for data manipulation – NoSQL databases use different query methods, not just SQL.
4 -✔ They are optimized for big data – NoSQL databases are built for scalability and handling large volumes of data efficiently.
When a non-key column cannot depend on part of a composite primary key, we know that table is in:
Example:
A table is in ______ if it has no partial dependencies, meaning all non-key attributes depend on the entire primary key.
1 - 1NF
2 - 3NF
3 - 2NF
4 - Boyce-Codd NF
1 - 1NF – Ensures atomicity but does not address partial dependencies.
2 - 3NF – Removes transitive dependencies but requires 2NF first.
3 -✔ 2NF – Ensures that non-key attributes depend on the whole primary key, eliminating partial dependencies.
4 - Boyce-Codd NF – A stricter form of 3NF but requires 2NF first.
Which term describes the process of denormalization?
Example:
______ involves combining tables or introducing redundancy to improve query performance at the cost of normalization.
1 - Composite Key
2 - 3rd Normal Form
3 - Merging Tables
4 - Trivial Dependency
1 - Composite Key – A key consisting of multiple columns but not related to denormalization.
2 - 3rd Normal Form – A normalization stage that reduces redundancy, opposite of denormalization.
3 -✔ Merging Tables – Denormalization often involves merging tables to reduce joins and improve performance.
4 - Trivial Dependency – A dependency where an attribute is functionally dependent on itself, unrelated to denormalization.
Which of the following modifications will bring the Order table to the next normal form?
Example:
To eliminate partial dependencies and improve normalization, ______ should be used to separate repeating groups into different tables.
1 - Split the Order table into two tables: TABLE A: OrderID, CustomerID, OrderDate, and TABLE B: ProductID, ProductName, and Quantity.
2 - Split the Order table into two tables: TABLE A: OrderID, CustomerID, OrderDate, and TABLE B: ProductID and ProductName.
3 - Split the Order table into two tables: TABLE A: OrderID, CustomerID, OrderDate, and TABLE B: ProductID, OrderID, ProductName, Quantity.
4 - Split the Order table into two tables: TABLE A: OrderID, CustomerID, OrderDate, Quantity, TABLE B: CustomerID and CustomerName ProductID.
1 - This does not preserve the relationship between orders and products.
2 - ProductID and ProductName should be linked to specific orders.
3 -✔ This structure removes partial dependencies, ensuring that products are associated with orders correctly.
4 - The structure of TABLE B is incorrect, and it does not properly normalize the table.
A column in Table B has been indexed. Which action would cause the index to be updated?
Example:
A column in Table B has been indexed. The index must be updated whenever ______ occurs in the indexed column to maintain accuracy.
1 - A different table is joined with Table B
2 - A different column is updated in Table B
3 - A row is deleted from Table B
4 - A new column is added to Table B
1 - A different table is joined with Table B – Joining a table does not modify the indexed data.
2 - A different column is updated in Table B – Updating a different column does not affect the indexed column.
3 -✔ A row is deleted from Table B – Deleting a row removes indexed data, requiring the index to be updated.
4 - A new column is added to Table B – Adding a new column does not impact existing indexes.