Introduction To SQL True Or False Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Aparnasunil75
A
Aparnasunil75
Community Contributor
Quizzes Created: 20 | Total Attempts: 43,504
| Attempts: 2,648 | Questions: 12
Please wait...
Question 1 / 12
0 %
0/100
Score 0/100
1. Unique constraints ensures that all the values in a column are distinct/unique.

Explanation

Unique constraints are used in a database to ensure that all values in a specific column are unique. This means that no two rows in that column can have the same value. By enforcing this constraint, it helps maintain data integrity and prevents duplicate entries. Therefore, the given statement is true.

Submit
Please wait...
About This Quiz
Introduction To SQL True Or False Quiz - Quiz

What is SQL? Have you ever used SQL programming language? Here, we have this "Introduction to SQL quiz" in the true or false format to check your knowledge... see moreregarding this standard language. SQL is a database computer language used for storing, manipulating, and retrieving data in relational databases. SQL is extended as a structured query language. Do you know about primary and unique keys? If so, take this test and see how much you know about SQL. All the best!
see less

2. A relation may have multiple foreign keys.

Explanation

In a relational database, a foreign key is a field or a set of fields that refers to the primary key of another table. Since a table can have multiple relationships with other tables, it is possible for it to have multiple foreign keys. These foreign keys establish the connections and maintain the integrity of the data across different tables. Therefore, the statement is true.

Submit
3. We can use DROP statement to remove a database or table permanently from the system.

Explanation

The DROP statement in SQL is used to permanently remove a database or table from the system. When we execute the DROP statement, it deletes the specified database or table, including all its data and associated objects. This action cannot be undone, so it is important to use the DROP statement with caution. Therefore, the given statement is true.

Submit
4. By default, each attribute can take NULL values except for the primary key.

Explanation

In a database, NULL represents the absence of a value. By default, each attribute in a table can have NULL values unless it is specified as the primary key. The primary key is a unique identifier for each record and cannot have NULL values. Therefore, the statement "By default, each attribute can take NULL values except for the primary key" is true.

Submit
5. The result of a SELECT statement can contain duplicate rows.  

Explanation

A SELECT statement in SQL retrieves data from a database table. It is possible for the result of a SELECT statement to contain duplicate rows if the table being queried has duplicate data. This can happen if there are multiple records in the table with the same values for all columns. Therefore, the statement "The result of a SELECT statement can contain duplicate rows" is true.

Submit
6. SQL Server automatically sets the NOT NULL constraint for all the primary key columns if the NOT NULL constraint is not specified for these columns.

Explanation

In SQL Server, when a primary key column is defined, it is automatically set with the NOT NULL constraint. This means that the column cannot have a null value, ensuring that each record in the table will have a unique value for the primary key column. Therefore, the statement "True" is correct.

Submit
7. Each table can contain more than one primary key.

Explanation

Each table can have only one primary key. A primary key is a unique identifier for each row in a table and ensures that each row is uniquely identified. Having more than one primary key in a table would contradict this purpose.

Submit
8. We can insert two records with same roll number in a table if roll is assigned as primary key.

Explanation

It is not possible to insert two records with the same roll number in a table if the roll number is assigned as a primary key. A primary key is a unique identifier for each record in a table, and it ensures that no two records have the same value for that particular column. Therefore, if the roll number is set as the primary key, it will enforce uniqueness and prevent the insertion of duplicate records with the same roll number.

Submit
9. It is mandatory to define constraint for each attribute of a table.

Explanation

It is not mandatory to define a constraint for each attribute of a table. Constraints are used to enforce rules and restrictions on the data in a table, such as ensuring that certain columns cannot have null values or that values must be unique. While it is good practice to define constraints for attributes that require them, it is not required for every attribute in a table.

Submit
10. Primary Key does allow the Null Values. where as in Unique key doesn't accept the Null values

Explanation

The explanation for the given correct answer is that the statement is incorrect. In a database, a primary key is a column or a set of columns that uniquely identifies each record in a table. Primary keys do not allow null values, meaning that every record must have a value in the primary key column. On the other hand, a unique key also ensures uniqueness but allows null values. Therefore, the statement that primary keys allow null values is false.

Submit
11. A NULL value is treated as a blank or zero.

Explanation

A NULL value is not treated as a blank or zero. In databases, a NULL value represents the absence of a value or unknown information. It is different from a blank or zero, as it indicates that the value is missing or undefined.

Submit
12. Each foreign key is defined on a multiple attribute.

Explanation

Foreign keys are used to establish a relationship between two tables in a database. They are defined on a single attribute or column in a table, not on multiple attributes. The purpose of a foreign key is to ensure referential integrity, meaning that the values in the foreign key column must match the values in the referenced primary key column. Therefore, the given statement is incorrect, and the correct answer is False.

Submit
View My Results

Quiz Review Timeline (Updated): Aug 24, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Aug 24, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 19, 2020
    Quiz Created by
    Aparnasunil75
Cancel
  • All
    All (12)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Unique constraints ensures that all the values in a column are...
A relation may have multiple foreign keys.
We can use DROP statement to remove a database or table permanently...
By default, each attribute can take NULL values except for the primary...
The result of a SELECT statement can contain duplicate rows....
SQL Server automatically sets the NOT...
Each table can contain more than one primary key.
We can insert two records with same roll number in a table if roll is...
It is mandatory to define constraint for each attribute of a table.
Primary Key does allow the Null Values. where as in Unique...
A NULL value is treated as a blank or zero.
Each foreign key is defined on a multiple attribute.
Alert!

Advertisement