SQL 面试题与答案
问题 101. What are the wildcards used for pattern matching.?
_ for single character substitution and % for multi-character substitution.
问题 102. What is the parameter substitution symbol used with INSERT INTO command?
&
问题 103. What's an SQL injection?
SQL Injection is when form data contains an SQL escape sequence and injects a new SQL query to be run.
问题 104. What is difference between TRUNCATE & DELETE ?
TRUNCATE commits after deleting entire table i.e., cannot be rolled back. Database triggers do not fire on TRUNCATE
DELETE allows the filtered deletion. Deleted records can be rolled back or committed. Database triggers fire on DELETE.
问题 105. What is a join? Explain the different types of joins?
Join is a query, which retrieves related columns or rows from multiple tables.
Self Join - Joining the table with itself.
Equi Join - Joining two tables by equating two common columns.
Non-Equi Join - Joining two tables by equating two common columns.
Outer Join - Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.
用户评价最有帮助的内容: