SQL Basic! Ultimate Trivia Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Jayachandraac5
J
Jayachandraac5
Community Contributor
Quizzes Created: 1 | Total Attempts: 593
Questions: 10 | Attempts: 593

SettingsSettingsSettings
SQL Basic! Ultimate Trivia Quiz - Quiz

.


Questions and Answers
  • 1. 

    Which SQL function is used to count the number of rows in a SQL query?

    • A.

       COUNT()

    • B.

      NUMBER()

    • C.

      SUM()

    • D.

      COUNT(*)

    Correct Answer
    D. COUNT(*)
    Explanation
    The COUNT(*) function is used to count the number of rows in a SQL query. It returns the number of rows that match the specified condition or criteria in the query. The asterisk (*) in COUNT(*) is a wildcard that represents all columns in the table, so it counts all rows regardless of the values in any specific column. This function is commonly used to obtain the total number of records in a table or to count the number of rows that meet certain criteria.

    Rate this question:

  • 2. 

    Which SQL keyword is used to retrieve a maximum value?

    • A.

      MOST

    • B.

       TOP

    • C.

      MAX

    • D.

      UPPER

    Correct Answer
    C. MAX
    Explanation
    The keyword "MAX" is used in SQL to retrieve the maximum value from a specified column. It is commonly used in conjunction with the SELECT statement and the GROUP BY clause to find the highest value in a specific column or set of columns.

    Rate this question:

  • 3. 

    Which of the following SQL clauses is used to DELETE tuples from a database table?

    • A.

      DELETE

    • B.

      REMOVE

    • C.

      DROP

    • D.

      CLEAR

    Correct Answer
    A. DELETE
    Explanation
    The DELETE clause in SQL is used to remove or delete tuples from a database table. It allows for the selective removal of specific rows based on certain conditions specified in the WHERE clause. This clause is commonly used to remove unwanted or outdated data from a table, maintaining data integrity and keeping the database clean and organized.

    Rate this question:

  • 4. 

    If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default __________

    • A.

      ASC

    • B.

      DESC

    • C.

      There is no default value

    • D.

      None of the mentioned

    Correct Answer
    A. ASC
    Explanation
    If you don't specify ASC or DESC after a SQL ORDER BY clause, the default is ASC. ASC stands for "ascending" and it arranges the data in ascending order, meaning from the smallest value to the largest value.

    Rate this question:

  • 5. 

    Which of the following function is an aggregate function?

    • A.

      Union

    • B.

      Like

    • C.

      Group By

    • D.

      Max

    Correct Answer
    D. Max
    Explanation
    Max is an aggregate function because it is used to find the maximum value in a set of values. It is commonly used in SQL queries to retrieve the maximum value from a specific column in a table. The Max function takes multiple values as input and returns the largest value among them. It is often used in conjunction with the Group By clause to find the maximum value for each group in a result set.

    Rate this question:

  • 6. 

    Which statement is wrong about PRIMARY KEY constraint in SQL?

    • A.

      The PRIMARY KEY uniquely identifies each record in a SQL database table

    • B.

      Primary key can be made based on multiple columns

    • C.

      Primary key must be made of any single columns

    • D.

      Primary keys must contain UNIQUE values.

    Correct Answer
    C. Primary key must be made of any single columns
    Explanation
    The statement that is wrong about the PRIMARY KEY constraint in SQL is "Primary key must be made of any single columns". This is incorrect because a primary key can be made based on multiple columns.

    Rate this question:

  • 7. 

    In existing table, ALTER TABLE statement is used to

    • A.

      Add columns

    • B.

      Add constraints

    • C.

      Delete columns

    • D.

      Delete constrains

    • E.

      All of the above

    Correct Answer
    E. All of the above
    Explanation
    The ALTER TABLE statement in SQL is used to modify an existing table. It can be used to add columns to the table, add constraints to the table, delete columns from the table, and delete constraints from the table. Therefore, the correct answer is "All of the above" as the ALTER TABLE statement can perform all of these actions on an existing table.

    Rate this question:

  • 8. 

    Wrong statement about UPDATE keyword is

    • A.

      If WHERE clause in missing in statement the all records will be updated.

    • B.

      Only one record can be updated at a time using WHERE clause

    • C.

      Multiple records can be updated at a time using WHERE clause

    • D.

      None is wrong statement

    Correct Answer
    B. Only one record can be updated at a time using WHERE clause
    Explanation
    The correct answer is "Only one record can be updated at a time using WHERE clause." This is because the WHERE clause is used to specify the condition that must be met for the update to occur. If the WHERE clause is missing, the update statement will update all records in the table. However, if the WHERE clause is present and specifies a condition, only the record(s) that meet that condition will be updated. Therefore, multiple records can be updated at a time using the WHERE clause, but each update will only affect one record.

    Rate this question:

  • 9. 

    Wrong statement about ORDER BY keyword is

    • A.

      Used to sort the result-set in ascending or descending order

    • B.

      The ORDER BY keyword sorts the records in ascending order by default.

    • C.

      To sort the records in ascending order, use the ASC keyword.

    • D.

      To sort the records in descending order, use the DECENDING keyword.

    Correct Answer
    D. To sort the records in descending order, use the DECENDING keyword.
  • 10. 

    In a table, a column contains a duplicate value, if you want to list all different value only, then which SQL clause is used?

    • A.

      SQL DISTINCT

    • B.

      SQL UNIQUE

    • C.

      SQL BETWEEN

    • D.

      SQL Exists

    Correct Answer
    A. SQL DISTINCT
    Explanation
    The SQL DISTINCT clause is used to retrieve only unique values from a column in a table. It eliminates any duplicate values and returns a result set with only distinct values. Therefore, if you want to list all different values from a column that contains duplicates, you would use the SQL DISTINCT clause.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 17, 2020
    Quiz Created by
    Jayachandraac5

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.