MySQL Quiz - Unlock Synoriq

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 Diksha
D
Diksha
Community Contributor
Quizzes Created: 1 | Total Attempts: 295
Questions: 14 | Attempts: 295

SettingsSettingsSettings
MySQL Quiz - Unlock Synoriq - Quiz


Questions and Answers
  • 1. 

    How can we get the number of records or rows in a table?

    • A.

      Using COUNT

    • B.

      Using NUM

    • C.

      Using NUMBER

    • D.

      Both a and c above

    Correct Answer
    A. Using COUNT
    Explanation
    To get the number of records or rows in a table, we can use the COUNT function. This function allows us to count the number of rows that meet a specific condition or count all the rows in the table if no condition is specified. Therefore, the correct answer is "Using COUNT" because it is the appropriate method to obtain the desired result.

    Rate this question:

  • 2. 

    Which of the following ways below are the correct way to get the current date?

    • A.

      SELECT CURTIME();

    • B.

      SELECT CURDATE();

    • C.

      SELECT CURRRENT_TIME()

    • D.

      All of the above

    Correct Answer
    B. SELECT CURDATE();
    Explanation
    The correct SQL command to retrieve the current date is SELECT CURDATE();. Option A, CURTIME(), retrieves the current time, not the date. Option C is incorrect due to a typo ("CURRRENT_TIME" should be "CURRENT_TIME()"), which retrieves the current time as well. Therefore, the only correct option for getting the current date is SELECT CURDATE();.

    Rate this question:

  • 3. 

    In a LIKE clause, you can could ask for any value ending in “ton” by writing

    • A.

      LIKE ton$

    • B.

      LIKE ^.*ton$

    • C.

      LIKE %ton

    • D.

      LIKE *ton

    • E.

      LIKE .*ton

    Correct Answer
    C. LIKE %ton
    Explanation
    The correct answer is "LIKE %ton". This is because the "%" symbol is used as a wildcard character in SQL, representing any number of characters. So when we write "LIKE %ton", it means we are looking for any value that ends with "ton".

    Rate this question:

  • 4. 

    Which of these commands will delete a table called XXX if you have appropriate authority

    • A.

      DROP XXX

    • B.

      DELETE XXX WHERE confirm = “YES”

    • C.

      DROP XXX WHERE confirm = “YES”

    • D.

      DROP TABLE XXX

    • E.

      DELETE XXX

    • F.

      DELETE TABLE XXX

    Correct Answer
    D. DROP TABLE XXX
    Explanation
    The correct answer is "DROP TABLE XXX". This command is used to delete a table called XXX if the user has appropriate authority. The "DROP" keyword is used to remove an entire table from the database, and "TABLE" specifies that it is a table that should be dropped. The other options either have incorrect syntax or do not specify that a table should be dropped.

    Rate this question:

  • 5. 

    Which of the following is NOT available in MySQL:

    • A.

      REVOKE

    • B.

      FETCH

    • C.

      LIKE

    • D.

      JOIN

    • E.

      SELECT

    Correct Answer
    B. FETCH
  • 6. 

    Which command is used to set the current database to “mysql”?

    • A.

      SHOW mysql

    • B.

      CREATE mysql

    • C.

      USE mysql

    • D.

      DESCRIBE mysql

    Correct Answer
    C. USE mysql
    Explanation
    The correct answer is "USE mysql". This command is used to set the current database to "mysql". It is used to switch to a different database in order to perform operations on that specific database.

    Rate this question:

  • 7. 

    Which of the following is not a comment in MySQL

    • A.

      /* This code is commented */

    • B.

      # This code is commented

    • C.

      /# This code is commented

    • D.

      -- This code is commented

    Correct Answer
    C. /# This code is commented
    Explanation
    The given answer, "/# This code is commented," is not a valid comment in MySQL. In MySQL, comments can be made using the following formats: "/* This code is commented */", "# This code is commented", and "-- This code is commented". However, "/# This code is commented" is not a recognized comment format in MySQL.

    Rate this question:

  • 8. 

    Which join refers to join records from the right table that have no matching key in the left table are include in the result set:  

    • A.

      Left outer join  

    • B.

      Right outer join

    • C.

      Full outer join

    • D.

      Half outer join

    Correct Answer
    B. Right outer join
    Explanation
    A right outer join refers to joining records from the right table that have no matching key in the left table and includes them in the result set. In other words, all the records from the right table are included in the result, and if there is no match in the left table, NULL values are used for the columns of the left table in the result set.

    Rate this question:

  • 9. 

    Which operation are allowed in a join view

    • A.

      UPDATE

    • B.

      INSERT

    • C.

      DELETE

    • D.

      All of the mentioned

    Correct Answer
    D. All of the mentioned
    Explanation
    In a join view, all of the mentioned operations (UPDATE, INSERT, DELETE) are allowed. This means that you can update, insert, and delete records in a join view. This allows for more flexibility and control over the data in the view, as you can make changes to the underlying tables through the join view.

    Rate this question:

  • 10. 

    Which of the following is not a class of constraint in SQL Server?

    • A.

      NOT NULL  

    • B.

      CHECK

    • C.

      NULL

    • D.

      UNIQUE

    Correct Answer
    C. NULL
    Explanation
    The correct answer is NULL. In SQL Server, NULL is not a class of constraint. The NOT NULL constraint ensures that a column cannot have a NULL value, the CHECK constraint specifies a condition that must be true for each row, and the UNIQUE constraint ensures that all values in a column are unique. However, NULL itself is not a constraint class, but rather a value that represents the absence of data.

    Rate this question:

  • 11. 

    Constraints can be applied on ___________

    • A.

      Column

    • B.

      Table

    • C.

      Field

    • D.

      All of the mentioned

    Correct Answer
    D. All of the mentioned
    Explanation
    Constraints can be applied on columns, tables, and fields in a database. Constraints are used to enforce rules and restrictions on the data that is stored in the database. By applying constraints, we can ensure data integrity and maintain consistency in the database. Therefore, all of the mentioned options (columns, tables, and fields) can have constraints applied to them.

    Rate this question:

  • 12. 

    Purpose of foreign key constraint in SQL Server is __________

    • A.

      FOREIGN KEY constraints identify and enforce the relationships between tables  

    • B.

      A foreign key in one table points to a candidate key in another table  

    • C.

      You cannot insert a row with a foreign key value, except NULL, if there is no candidate key with that value  

    • D.

      None of the mentioned  

    Correct Answer
    A. FOREIGN KEY constraints identify and enforce the relationships between tables  
    Explanation
    The purpose of a foreign key constraint in SQL Server is to identify and enforce the relationships between tables. This means that a foreign key in one table points to a candidate key in another table, establishing a connection between the two tables. This constraint ensures that you cannot insert a row with a foreign key value unless there is a corresponding candidate key with that value.

    Rate this question:

  • 13. 

    . Which of the constraint can be enforced one per table?

    • A.

       Primary key constraint  

    • B.

      Not Null constraint  

    • C.

      Foreign Key constraint  

    • D.

      Check constraint

    Correct Answer
    A.  Primary key constraint  
    Explanation
    The primary key constraint can be enforced one per table. This constraint ensures that each row in a table has a unique identifier, which is the primary key. It prevents duplicate values from being inserted into the primary key column and helps maintain data integrity. Additionally, the primary key constraint also automatically creates an index on the primary key column, which improves query performance.

    Rate this question:

  • 14. 

    Which of the following SQL clauses is used to filter rows after an aggregation in a MySQL query?

    • A.

      WHERE

    • B.

      HAVING

    • C.

      GROUP BY

    • D.

      ORDER BY

    Correct Answer
    B. HAVING
    Explanation
    The HAVING clause is used to filter rows after an aggregation in a MySQL query. While the WHERE clause is used to filter rows before any aggregation occurs, HAVING is specifically used after the GROUP BY clause to filter groups based on the aggregate values. The GROUP BY clause groups rows, and ORDER BY is used to sort the result set.

    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
  • Aug 20, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 28, 2020
    Quiz Created by
    Diksha

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.