Database retest interview

These data are sorted out in reference to various chiefs article footing part of the contents for reference purposes only.
1. About Paradigm

Personal understanding, then, the most important feature of the first paradigm is indivisible, single attributes are separate, second paradigm, then, is to have a primary key, and other properties are completely dependent on the primary key, the third paradigm, then, is to eliminate redundancy, information exists only one place in the table, rather than a plurality of places, i.e., dependent on the absence of transmission, corresponding to the non-primary key column a depends on B, non-primary key column B is dependent on the primary key non-primary key column C.

2. The primary and foreign keys

Primary key is the only representative of a property sheet, and only one, and can not be null foreign key is present in this table, the primary key of another table.

3. Trigger

That is, sql language, when the trigger condition is met, the implementation of the trigger language collection.

Question 4. affairs

Transaction itself mean that a series of operations generated by a logic unit.
Itself contains four attributes: 1 atomic: either executed or not executed. 2. Isolation: All operations previously executed, other sessions can not see the process. 3. Consistency: before and after the transaction, the total amount of data consistency. 4. Durability: Once a transaction is committed, modify the system is permanent.

The operation with respect to drop, delete, turncate of

Mainly, the three biggest difference is, 1.drop directly delete this table. 2.delete delete some or all of the table data, and may be submitted by commit or rollback rollback. 3.turncate directly delete data in this table without deleting the table.

6. The difference between the views and tables

Results are stored in a database table, but only one or more tables view by combining certain conditions, in general, can be inserted into the data table delete operation, and to select only the view operating.

7. difference on cold backup and hot backup

Cold backup is equivalent to the storage of data in the system has been shut down under, the data on a position above the other, while hot backup operation is performed in the case where the system is running under, while the backup operation while , consume more space.

join, outer join, cross join contact 8. databases inner.

equivalent inner join is the intersection of two sets of
outer join contains right join left join and
represent: generating a complete set table on the right and the left side of the table does not exist or null data, and displays the presence data generated left of the table complete set, and the right table does not exist null data indicated the presence of data is displayed.
cross join: the equivalent of two tables is to be Cartesian product.

And char the difference 9.varchar2

In fact, the difference is about the length, varchar is of variable length, and the length of the char is fixed

10. What is dirty reads, non reread, lost updates

Dirty read: Transaction T1
updated data R, and then read transaction T2's update data R, but for some reason the transaction T1 is revoked, invalid edit, R back into, so T2 read data before updating and the data in the database is not the same, this is a dirty read
is not reread: transaction T1 read data R, then the transaction T2 is also read data R, and to update it, then the time T1 is read again, will find R and data before him is not the same, this is not reread
lost update: transaction T1 and T1 while the data R has been modified, but the T1 to T2 or T2 to T1 modified results overwritten, resulting in data loss, which is lost updates

Published 72 original articles · won praise 5 · Views 2824

Guess you like

Origin blog.csdn.net/qq_41115379/article/details/104873194