50 multiple-choice questions with answers and detailed explanations. Untimed — choose an answer to check it instantly.
0/50 answered0 correct
Question 1 of 50
Which normal form ensures that every cell contains exactly one value and every table has a primary key?
Correct answer: A) First Normal Form (1NF)
Explanation: First Normal Form (1NF) ensures that every cell contains exactly one value and that the table has a primary key. This is the most basic form of database normalization.
Question 2 of 50
In SQL, which keyword is used to prevent a column from having a NULL value?
Correct answer: A) NOT NULL
Explanation: The NOT NULL keyword is used to ensure that a column does not accept NULL values. It is added in the column definition during table creation.
Question 3 of 50
Which type of join in SQL selects all rows from the left table and only matching rows from the right table?
Correct answer: C) LEFT JOIN
Explanation: A LEFT JOIN selects all rows from the left table and only the matching rows from the right table. Rows from the left table without a match in the right table will have NULLs in the columns from the right table.
Question 4 of 50
Which SQL operator is used to compare columns using the = operator?
Correct answer: D) EQUIJOIN
Explanation: An EQUIJOIN is used to compare columns using the = operator in SQL. It is the most common type of join where two tables are joined based on equality between specified columns.
Question 5 of 50
Which type of key in a table uniquely identifies a row and cannot be NULL?
Correct answer: C) Primary Key
Explanation: A Primary Key uniquely identifies each row in a table and must always have unique, non-NULL values.
Question 6 of 50
In database design, which phase specifies the structure and organization of the database tables?
Correct answer: B) Physical Design
Explanation: Physical Design specifies how the database tables are organized on storage media, including indexes and partitions, to optimize query performance.
Question 7 of 50
Which type of index contains an entry for every row in a table?
Correct answer: B) Dense Index
Explanation: A Dense Index contains an entry for every row in the table, unlike a Sparse Index, which contains entries for only certain rows or blocks.
Question 8 of 50
In relational databases, what does the term “cardinality” refer to?
Correct answer: B) The number of times an entity can be related to another entity
Explanation: Cardinality refers to the maximum and minimum number of times one entity can be related to instances of another entity in a relational database. conversion funnel outlines the stages users go through on their way to completing a goal, such as making a purchase or signing up for a newsletter.
Question 9 of 50
Which SQL statement is used to create a new table in a database?
Correct answer: B) CREATE TABLE
Explanation: The CREATE TABLE statement is used to define and create a new table by specifying its column names, data types, and constraints. pack displays a group of nearby businesses relevant to a user’s query, often alongside a map, and appears in organic search results.
Question 10 of 50
Which type of relationship is defined when a foreign key in one table refers to the primary key of another table?
Correct answer: A) One-to-Many
Explanation: A One-to-Many relationship is established when a foreign key in one table refers to the primary key in another table, allowing multiple rows in the first table to relate to a single row in the second.
Question 11 of 50
Which SQL function returns the minimum value in a set of rows?
Correct answer: B) MIN()
Explanation: The MIN() function returns the smallest value from a set of rows in SQL. It is often used to find the minimum value in a numeric column.
Question 12 of 50
What is the primary purpose of the TRUNCATE statement in SQL?
Correct answer: B) Deletes all rows from a table
Explanation: The TRUNCATE statement in SQL is used to remove all rows from a table but keeps the table structure intact for future use.
Question 13 of 50
Which database object is used to define rules that enforce data integrity, such as preventing invalid values?
Correct answer: B) Constraint
Explanation: Constraints are rules defined on columns to enforce data integrity, ensuring that only valid data is inserted, updated, or deleted.
Question 14 of 50
What is the key characteristic of an AUTO_INCREMENT column in SQL?
Correct answer: B) It is automatically assigned a unique number for each row.
Explanation: An AUTO_INCREMENT column automatically generates a unique, sequential number for each new row inserted into the table.
Question 15 of 50
In which normal form are all non-key columns dependent on the whole primary key and nothing else?
Correct answer: C) Third Normal Form (3NF)
Explanation: Third Normal Form (3NF) requires that all non-key columns depend on the primary key and no other non-key column.
Question 16 of 50
Which SQL clause is used to filter results based on a condition?
Correct answer: C) WHERE
Explanation: The WHERE clause filters the results returned by a query based on the specified condition, such as comparing column values.
Question 17 of 50
Which type of index only stores entries for certain blocks of a table rather than every row?
Correct answer: B) Sparse Index
Explanation: A Sparse Index stores entries only for certain blocks of a table, making it more efficient for larger datasets where not every row needs to be indexed.
Question 18 of 50
Which type of join returns rows that have matching values in both the left and right tables?
Correct answer: A) INNER JOIN
Explanation: An INNER JOIN returns only the rows that have matching values in both the left and right tables. It excludes rows that do not have matches in either table.
Question 19 of 50
What is the primary function of a foreign key in a relational database?
Correct answer: B) To refer to the primary key in another table
Explanation: A foreign key in a relational database is used to create a link between two tables by referencing the primary key in another table.
Question 20 of 50
Which aggregate function in SQL calculates the total sum of values in a column?
Correct answer: C) SUM()
Explanation: The SUM() function adds together all the values in a specified column and returns the total.
Question 21 of 50
In database design, what does a composite primary key consist of?
Correct answer: B) Multiple columns
Explanation: A composite primary key is made up of two or more columns in a table, and together these columns uniquely identify each row.
Question 22 of 50
Which type of join includes all rows from the left and right tables, regardless of whether they have matches?
Correct answer: B) FULL JOIN
Explanation: A FULL JOIN selects all rows from both tables, regardless of whether there is a match, filling in NULLs where necessary.
Question 23 of 50
Which type of index is used in SQL databases to assign entries to buckets?
Correct answer: B) Hash Index
Explanation: A Hash Index assigns index entries to buckets using a hash function, which computes a bucket number from the value of the indexed column.
Question 24 of 50
What does the SQL clause GROUP BY do?
Correct answer: C) Groups rows that have the same values in specified columns
Explanation: The GROUP BY clause groups rows that have the same values in specified columns, often used with aggregate functions like SUM() or COUNT(). EQUIJOIN is used to compare columns using the = operator in SQL. It is the most common type of join where two tables are joined based on equality between specified columns.
Question 25 of 50
Which command in SQL deletes a table from a database entirely, including all rows and structure?
Correct answer: C) DROP TABLE
Explanation: The DROP TABLE command removes an entire table, including its rows and structure, from the database.
Question 26 of 50
In SQL, which operator is used for pattern matching with wildcards?
Correct answer: A) LIKE
Explanation: The LIKE operator is used for pattern matching in SQL, often with wildcard characters such as '%' for multiple characters or '_' for a single character.
Question 27 of 50
Which SQL statement is used to change the data in an existing row in a table?
Correct answer: B) UPDATE
Explanation: The UPDATE statement is used to modify the data in existing rows in a table by specifying new values for the columns.
Question 28 of 50
Which SQL command is used to create an index on one or more columns of a table?
Correct answer: A) CREATE INDEX
Explanation: The CREATE INDEX command creates an index on one or more columns of a table to improve the speed of data retrieval operations.
Question 29 of 50
Which clause in SQL is used to limit the number of rows returned by a SELECT statement?
Correct answer: C) LIMIT
Explanation: The LIMIT clause is used to specify the maximum number of rows to be returned by a SELECT query, limiting the result set.
Question 30 of 50
In a relational database, what does the term “schema” refer to?
Correct answer: A) The structure of a database, including tables, columns, and relationships
Explanation: The schema of a database defines its structure, including the tables, columns, data types, and relationships between tables. established when a foreign key in one table refers to the primary key in another table, allowing multiple rows in the first table to relate to a single row in the second.
Question 31 of 50
Which SQL operator is used to return unique values from a column?
Correct answer: A) DISTINCT
Explanation: The DISTINCT operator returns only unique values from a column, removing any duplicate values from the result set.
Question 32 of 50
Which type of key in a table is used to refer to the primary key in another table?
Correct answer: A) Foreign Key
Explanation: A Foreign Key is used to refer to the primary key in another table, establishing a relationship between the two tables.
Question 33 of 50
What is the purpose of a CHECK constraint in SQL?
Correct answer: A) To ensure that values in a column follow a specific rule
Explanation: A CHECK constraint ensures that values in a column must satisfy a specified condition or rule, enforcing data integrity.
Question 34 of 50
In which normal form is a table if all columns are functionally dependent on the primary key, and there are no transitive dependencies?
Correct answer: C) Third Normal Form (3NF)
Explanation: A table is in Third Normal Form (3NF) when all columns are functionally dependent on the primary key and there are no transitive dependencies between non-key columns.
Question 35 of 50
Which SQL statement is used to delete specific rows from a table based on a condition?
Correct answer: A) DELETE
Explanation: The DELETE statement is used to remove specific rows from a table based on a condition specified in the WHERE clause.
Question 36 of 50
Which clause in SQL is used to filter rows before grouping them in a GROUP BY query?
Correct answer: B) WHERE
Explanation: The WHERE clause filters rows before they are grouped in a GROUP BY query, applying conditions to individual rows.
Question 37 of 50
Which type of key uniquely identifies each row in a table and must always contain unique, non-null values?
Correct answer: A) Primary Key
Explanation: The Primary Key uniquely identifies each row in a table and ensures that no two rows have the same value in the primary key column(s).
Question 38 of 50
What is the main purpose of the ALTER TABLE command in SQL?
Correct answer: A) To modify the structure of an existing table
Explanation: The ALTER TABLE command is used to change the structure of an existing table, such as adding, removing, or modifying columns.
Question 39 of 50
Which type of join includes all rows from the right table and only matching rows from the left table?
Correct answer: C) RIGHT JOIN
Explanation: A RIGHT JOIN includes all rows from the right table and only the matching rows from the left table. Rows from the right table without a match in the left table will still appear in the result.
Question 40 of 50
Which term describes the dependence of one column on another in a table, where one value determines another?
Correct answer: A) Functional Dependence
Explanation: Functional Dependence occurs when one column's value is determined by another column's value in a database table.
Question 41 of 50
Which SQL operator is used to compare a value to a range of values?
Correct answer: B) BETWEEN
Explanation: The BETWEEN operator is used to compare a value to a range of values, specifying a minimum and maximum value in a query.
Question 42 of 50
Which SQL function calculates the number of rows returned by a query?
Correct answer: A) COUNT()
Explanation: The COUNT() function returns the number of rows in a result set, often used to determine how many rows meet certain criteria.
Question 43 of 50
What is the primary function of a Unique Key in a database table?
Correct answer: C) To ensure that a column has unique values
Explanation: A Unique Key ensures that all values in a specified column or set of columns are distinct, preventing duplicate entries.
Question 44 of 50
Which aggregate function in SQL calculates the average of values in a column?
Correct answer: A) AVG()
Explanation: The AVG() function calculates the arithmetic mean (average) of the values in a specified column.
Question 45 of 50
In relational databases, what does the term “entity” refer to?
Correct answer: C) A real-world object or concept represented in a table
Explanation: An entity represents a real-world object, person, or concept in a relational database, typically modeled as a table with attributes.
Question 46 of 50
Which SQL statement is used to change the values of existing rows in a table?
Correct answer: B) UPDATE
Explanation: The UPDATE statement is used to modify the values of existing rows in a table, typically by specifying new values for certain columns.
Question 47 of 50
Which SQL operator is used to filter results based on matching patterns in a text field?
Correct answer: C) LIKE
Explanation: The LIKE operator is used in SQL to filter rows based on matching patterns in a text field, often used with wildcards like % and _.
Question 48 of 50
Which type of key is used to uniquely identify each row in a table and must contain unique, non-null values?
Correct answer: B) Primary Key
Explanation: A Primary Key is used to uniquely identify each row in a table and must contain unique, non-null values to ensure data integrity.
Question 49 of 50
Which type of join returns rows from the left table and matching rows from the right table, filling in NULLs where there is no match?
Correct answer: A) LEFT JOIN
Explanation: A LEFT JOIN returns all rows from the left table and matching rows from the right table, filling in NULL values where there is no match.
Question 50 of 50
In relational databases, which constraint ensures that a foreign key value must match an existing primary key value or be NULL?
Correct answer: B) Referential Integrity
Explanation: Referential Integrity ensures that foreign key values in a table must either match an existing primary key value or be NULL, maintaining relationships between tables.
Set 1 complete
You scored 0%
0 correct out of 0 answered (50 questions in this set).