Basic SQL Quiz By - M Khan

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 Teradatakhan
T
Teradatakhan
Community Contributor
Quizzes Created: 1 | Total Attempts: 190
Questions: 5 | Attempts: 190

SettingsSettingsSettings
Basic SQL Quiz By - M Khan - Quiz


Questions and Answers
  • 1. 

    Sorts are Alphabetical in SQL, not Logical.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    In SQL, when sorting data, the default behavior is to sort alphabetically rather than logically. This means that if we have a list of values, SQL will sort them based on their alphabetical order rather than considering their logical order or any specific criteria. For example, if we have a list of numbers, SQL will sort them as if they were strings, resulting in an alphabetical order rather than a numerical order. Therefore, the statement "Sorts are Alphabetical in SQL, not Logical" is true.

    Rate this question:

  • 2. 

    Which one is wrong Alias syntax ?

    • A.

      First_name AS Fname

    • B.

      Last_name Lname

    • C.

      Class_Code "Class Code"

    • D.

      Grade_pt AS AVG

    Correct Answer
    D. Grade_pt AS AVG
    Explanation
    The given syntax "Grade_pt AS AVG" is incorrect because it does not follow the correct alias syntax. In alias syntax, the keyword "AS" is used to assign an alias to a column or expression. The correct syntax would be "Grade_pt AS AVG" where "Grade_pt" is the column or expression being aliased and "AVG" is the alias assigned to it.

    Rate this question:

  • 3. 

    SELECT * FROM Student_table WHERE Grade_pt = 3.0 OR 4.0; What will be the result ?

    • A.

      Display students from Grade_pt 3.0 or 4.0

    • B.

      Will show syntax error

    • C.

      Display only students from Grade_pt 3.0

    • D.

      Not Sure

    Correct Answer
    B. Will show syntax error
    Explanation
    The given SQL query is correct and will not show a syntax error. It will display all the rows from the Student_table where the Grade_pt is either 3.0 or 4.0.

    Rate this question:

  • 4. 

    What is the order of Precedence in SQL ?

    • A.

      ( ) NOT OR AND

    • B.

      AND OR NOT ( )

    • C.

      NOT OR ( ) AND

    • D.

      ( ) NOT AND OR

    Correct Answer
    D. ( ) NOT AND OR
    Explanation
    The order of precedence in SQL is determined by the use of parentheses, followed by the NOT operator, and then the AND and OR operators. In this case, the correct answer is "( ) NOT AND OR" which means that expressions inside parentheses are evaluated first, followed by the NOT operator, and then the AND and OR operators. This order ensures that the logical operations are performed in the correct sequence, allowing for accurate query results.

    Rate this question:

  • 5. 

    LIKE Keyword uses which two special character ?

    • A.

      # and @

    • B.

      $ and %

    • C.

      % and &

    • D.

      % and _ (underscore)

    Correct Answer
    D. % and _ (underscore)
    Explanation
    The LIKE keyword in SQL is used to search for a specified pattern in a column. It supports the use of two special characters: '%' and '_' (underscore). The '%' character is used to represent any sequence of characters, while the '_' character is used to represent a single character. Therefore, the correct answer is % and _ (underscore).

    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
  • May 06, 2014
    Quiz Created by
    Teradatakhan

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.