MySQL interview questions (a)

  1. Talk about the three paradigms database?
    A: The
    first paradigm: Each column of a database table are indivisible atomic data item.
    The second paradigm: the non-primary key column is fully dependent on the primary key, and not just rely on the part of the primary key.
    Third Pattern: non-primary key column only dependent on the primary key, not dependent on other non-primary key.

  2. How to get the current version of the database?
    A: Use the select version () to get the current version Mysql database.

  3. ? Learn what matters
    Answer: A transaction is a logical step in the execution unit by the sequence of operations or steps databases composed of a series of operations that either all executed or give up all executed.

  4. Talk about the four characteristics of the transaction?
    A: ACID.

  5. What A is?
    A: Atomicity, atomic, representing all operations in one transaction, or completed, or all do not complete, if an error occurs during the execution of the transaction, it will be rolled back to the state before the transaction began.

  6. What C is a?
    A: Consistency, consistency, the result of execution of transactions, it must make the database from one consistent state, change to another consistent state. When the database contains only the outcome of the transaction successfully committed, the database is in a consistent state. Consistency is ensured by atomicity.

  7. What I is?
    A: Isolation, isolation, since a plurality of concurrent transactions database allows simultaneous read and write capabilities and modify its data, a plurality of isolation to prevent cross transactions executing concurrently executed occurs when an inconsistent result data.

  8. D is the What?
    A: Durability, persistence, as long as the transaction successfully submitted, then for modifying data is permanent, even if the system crashes will not affect the outcome of this transaction.

  9. Talk about the characteristics of type char?
    A: For example, the definition of the char (10), then the length is fixed, even if the input is only "abcd" 4 characters, the space occupied is still 10 bytes, the other seven is null byte. But although char footprint, but its high efficiency, suitable for storing passwords md5 value, as long as the fixed length, use char type is very good.

  10. Varchar talk about the types of features?
    A: varchar type length is variable, the value stored is the value of each byte plus occupies a byte is used to record the length of its length, so it is compared to a char, varchar in space more reasonable, rather char places space for time, higher efficiency.

Published 289 original articles · won praise 302 · views 50000 +

Guess you like

Origin blog.csdn.net/weixin_38106322/article/details/104841658