SQL Multiple Choice Questions With Answers

Reviewed by Godwin Iheuwa
Godwin Iheuwa, MS (Computer Science) |
Database Administrator
Review Board Member
Godwin Iheuwa, a Database Administrator at MTN Nigeria, holds an MS in Computer Science, specializing in Agile Methodologies and Database Administration from the University of Bedfordshire and a Bachelor's in Computer Science from the University of Port Harcourt. His proficiency in SQL Server Integration Services (SSIS) and SQL Server Management Studio contributes to his expertise in database management.
, MS (Computer Science)
By Aparnasunil75
A
Aparnasunil75
Community Contributor
Quizzes Created: 20 | Total Attempts: 43,508
| Attempts: 12,510 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. Full form of RDBMS is

Explanation

The correct answer is "Relational database management system". RDBMS stands for Relational Database Management System, which is a software system that allows users to create, manage, and manipulate relational databases. It is a widely used approach for organizing and storing data in a structured manner, using tables with rows and columns to represent entities and their relationships. RDBMSs provide a set of tools and features for data storage, retrieval, and manipulation, ensuring data integrity and consistency.

Submit
Please wait...
About This Quiz
SQL Multiple Choice Questions With Answers - Quiz

Are you looking for some SQL multiple-choice questions with answers to make your preparation level better for the upcoming exam? Try our quiz below and see if you... see moreknow the basics of SQL programming language or not. SQL is the full form of the structured query language designed to work with databases. If you know the basics of SQL, this quiz will not be easy for you. You can test your SQL skills with us by taking the test. Go for it, then!
see less

2. Which of the following commands should be used to create a database named "student"?

Explanation

The correct answer is "CREATE DATABASE student" because the "CREATE DATABASE" command is used to create a new database, and "student" is the name specified for the new database.

Submit
3. Conditionally retrieval of rows from a table with SELECT, which clause is used? 

Explanation

The "WHERE" clause is used for conditionally retrieving rows from a table with the SELECT statement. It allows you to specify conditions that the retrieved rows must meet in order to be included in the result set. The WHERE clause is followed by a condition that evaluates to true or false for each row in the table, and only the rows that satisfy the condition are returned in the result set. This clause is essential for filtering and narrowing down the data that is retrieved from the table.

Submit
4. We use …………… operator with select for condition based on pattern matching.

Explanation

The LIKE operator is used with SELECT for conditions based on pattern matching. It allows us to search for a specified pattern within a column. It uses wildcard characters such as % (represents zero or more characters) and _ (represents a single character) to match patterns. This operator is commonly used in SQL queries to filter and retrieve data based on specific patterns or values.

Submit
5. A non-key attribute whose values are derived from the primary key of some other table. 

Explanation

A foreign key is a non-key attribute that is derived from the primary key of another table. It establishes a relationship between two tables by referencing the primary key of one table in another table. This allows for data consistency and integrity, as it ensures that the values in the foreign key column correspond to existing values in the referenced primary key column.

Submit
6. The ……………. keyword eliminates duplicate rows from the result of a SELECT statement. 

Explanation

The "Distinct" keyword eliminates duplicate rows from the result of a SELECT statement. When used in a query, it ensures that only unique values are returned, removing any duplicate rows that may be present in the result set. This is helpful when you want to retrieve only unique records from a table or when you need to perform calculations or analysis on distinct values.

Submit
7. The clause which sorts data of table.

Explanation

The Order by clause is used to sort the data of a table in a specific order. It allows you to arrange the result set in ascending or descending order based on one or more columns. This clause is commonly used in conjunction with the Select statement to organize the output according to certain criteria. By specifying the column(s) to sort by and the desired order, you can easily arrange the data in a meaningful way for analysis or presentation.

Submit
8. Which operator defines a range of values that the column values must fall in? 

Explanation

The operator "Between" is used to define a range of values that the column values must fall in. It is typically used in SQL queries to specify a range for a particular column. For example, "SELECT * FROM table WHERE column BETWEEN value1 AND value2" will retrieve all rows where the column value falls between value1 and value2.

Submit
9. How can you insert a new row into the "STORE" table. 

Explanation

The correct answer is "INSERT INTO STORE VALUES (1,‟ RAM SINGH‟);" because it follows the correct syntax for inserting a new row into a table. The "INSERT INTO" statement is used to specify the table name, followed by the "VALUES" keyword to indicate the values to be inserted. The values are then enclosed in parentheses and separated by commas.

Submit
10. To display the detail of employee having „e‟ in their name in descending order of salary the correct SQL statement is :

Explanation

The correct SQL statement is "SELECT * FROM emp WHERE ename LIKE '%e%' ORDER BY SAL DESC;" This statement selects all the columns from the "emp" table where the "ename" column contains the letter "e" anywhere in the name. It then orders the result in descending order of the "SAL" column.

Submit
11. _________is the attribute or group of attributes that uniquely identify occurrence of each entity.

Explanation

A primary key is the attribute or group of attributes that uniquely identify each occurrence of an entity. It serves as a unique identifier for each record in a database table, ensuring that no two records have the same key value. This key is crucial for maintaining data integrity and establishing relationships between tables in a relational database system. By defining a primary key, we can enforce uniqueness and facilitate efficient data retrieval and manipulation operations.

Submit
12. The USE command?

Explanation

The USE command should be used to choose the database you want to use once you've connected to MySQL. This command allows you to switch to a specific database and perform operations on it. It is important to select the appropriate database before executing any queries to ensure that the operations are performed on the correct database.

Submit
13. Which statement is valid? 

Explanation

The correct answer is "ALTER TABLE EMPLOYEE MODIFY (last_name VARCHAR2 (2000));". This statement is valid because it uses the correct syntax to modify the column "last_name" in the table "EMPLOYEE" to have a maximum length of 2000 characters using the VARCHAR2 data type. The other statements either use incorrect syntax or incorrect data types.

Submit
14. Which one will delete the table data as well as the table structure?

Explanation

DROP is the correct answer because it is a SQL command used to delete both the table data and the table structure. When the DROP command is executed on a table, it removes the entire table from the database, including all the data and the structure of the table. This operation cannot be undone, so it should be used with caution.

Submit
15. To specify a list of values …………. Operator is used. 

Explanation

The IN operator is used to specify a list of values. It allows you to check if a value matches any value in a list. For example, if you have a list of cities (New York, London, Paris) and you want to retrieve all the rows where the city is either New York or Paris, you can use the IN operator. This operator simplifies the query and makes it more efficient compared to using multiple OR conditions.

Submit
16. Which is a valid CREATE TABLE statement? 

Explanation

The correct answer is "Create table emp (id integer(3));". This is a valid CREATE TABLE statement because it follows the correct syntax for creating a table named "emp" with a column "id" of data type "integer" and a length of 3.

Submit
17. Which commands are used to define or redefine schema objects? 

Explanation

DDL stands for Data Definition Language and is used to define or redefine schema objects in a database. This includes creating, altering, and dropping tables, views, indexes, and other database objects. DDL commands are used to define the structure of the database and its objects, such as defining the columns and data types of a table. Therefore, the correct answer is DDL.

Submit
18. A row of relation is generally referred to as ……….. and a column of a relation is ………… 

Explanation

A row in a relation is commonly referred to as a tuple, while a column is referred to as an attribute.

Submit
19. A relation has 45 tuples & 5 attributes. What will be the Degree and Cardinality of that relation? 

Explanation

The degree of a relation refers to the number of attributes or columns in the relation. In this case, the relation has 5 attributes, so the degree is 5. The cardinality of a relation refers to the number of tuples or rows in the relation. Here, the relation has 45 tuples, so the cardinality is 45.

Submit
20. Which SQL statement will not generate any error message? 

Explanation

The SQL statement "SELECT * FROM EMP WHERE COMM IS NOT NULL;" will not generate any error message because it is a valid query that retrieves all records from the EMP table where the COMM column is not null. The other options in the question have syntax errors that would result in error messages.

Submit
View My Results
Godwin Iheuwa |MS (Computer Science) |
Database Administrator
Godwin Iheuwa, a Database Administrator at MTN Nigeria, holds an MS in Computer Science, specializing in Agile Methodologies and Database Administration from the University of Bedfordshire and a Bachelor's in Computer Science from the University of Port Harcourt. His proficiency in SQL Server Integration Services (SSIS) and SQL Server Management Studio contributes to his expertise in database management.

Quiz Review Timeline (Updated): Jun 17, 2024 +

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

  • Current Version
  • Jun 17, 2024
    Quiz Edited by
    ProProfs Editorial Team

    Expert Reviewed by
    Godwin Iheuwa
  • Mar 04, 2020
    Quiz Created by
    Aparnasunil75
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Full form of RDBMS is
Which of the following commands should be used to create a database...
Conditionally retrieval of rows from a table with SELECT, which clause...
We use …………… operator with select...
A non-key attribute whose values are derived from the primary key of...
The ……………. keyword eliminates...
The clause which sorts data of table.
Which operator defines a range of values that the column values must...
How can you insert a new row into the "STORE" table. 
To display the detail of employee having „e‟ in their name in...
_________is the attribute or group of attributes that uniquely...
The USE command?
Which statement is valid? 
Which one will delete the table data as well as the table structure?
To specify a list of values …………. Operator...
Which is a valid CREATE TABLE statement? 
Which commands are used to define or redefine schema objects? 
A row of relation is generally referred to as...
A relation has 45 tuples & 5 attributes. What will be the Degree...
Which SQL statement will not generate any error message? 
Alert!

Advertisement