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: 164
Questions: 14 | Attempts: 173

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
    D. All of the above
    Explanation
    All of the given options are correct ways to get the current date.
    - SELECT CURTIME() will return the current time in the format HH:MM:SS.
    - SELECT CURDATE() will return the current date in the format YYYY-MM-DD.
    - SELECT CURRENT_TIME() will return the current time in the format HH:MM:SS.
    Therefore, all three options can be used to retrieve the current date or time depending on the requirement.

    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. 

    Difference between a primary key and a unique key?

    • A.

      Primary key cannot be a date variable whereas unique key can be  

    • B.

      Primary key can take null values but unique key cannot null values

    • C.

      You can have only one primary key whereas you can have multiple unique keys  

    • D.

      None of the above

    Correct Answer
    C. You can have only one primary key whereas you can have multiple unique keys  
    Explanation
    The correct answer is that you can have only one primary key whereas you can have multiple unique keys. This is because a primary key is used to uniquely identify each record in a table and enforce entity integrity, while a unique key is used to ensure that each value in a column is unique. Therefore, a table can only have one primary key, but it can have multiple unique keys to enforce different uniqueness constraints on different columns.

    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 15, 2023
    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.