1. Question:What is the difference between primary key and unique? 

    Answer
    The PRIMARY KEY attribute is used to guarantee uniqueness for a given row. No values residing in a column designated as a primary key are repeatable or nullable within that column whereas a column assigned the UNIQUE attribute will ensure that all values possess distinct values, excenpt that NULL values are repeatable.

    1. Report
  2. Question:What are the purposes of GRANT and REVOKE commands? 

    Answer
    The GRANT and REVOKE commands are used to manage access privileges. GRANT command needs to assign new privileges to a user or group of users whereas the REVOKE command is responsible for deleting previously granted privileges from user or group of users.
    
    example: 
    mysql> GRANT select,insert ON library.book TO jone@localhost IDENTIFIED BY 'open123';
    mysql> REVOKE insert ON library.book TO jone@localhost;

    1. Report
  3. Question:What are the advantages of stored routine? 

    Answer
    Stored routines have a number of advantages, which are:
    1. Consistency
    2. Performance
    3. Security
    4. Architecture

    1. Report
  4. Question:What are the advantages of using indexes? 

    Answer
    1. It speeding database queries.
    2. Input criteria results in vast increases in performance over searching the entire unindexed table.

    1. Report
  5. Question:What are the differences between before triggers and after triggers? 

    Answer
    Before trigger when validating or modifying data that we intend to insert or update. On the other hand, an after trigger should be used when data is to be propagated or verified against other tables, and for carrying out calculations.

    1. Report
  6. Question:What are the purposes of INFORMATION_SCHEMA database? 

    Answer
    INFORMATION_SCHEMA offers a solution for using typical SELECT queries to learn more about databases and various server settings. Consisting of 16 tables, it\'s possible to learn about practically every aspect of installation.

    1. Report
  7. Question:What are the functions of --execute and --force option of mysql? 

    Answer
    --execute:Executes a query without having to actually enter the client interface. We can execute multiple Queries with this option by separating each with a semicolon.--force:When we used noninteractive mode mysql can read and execute queries found in a text file

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd