Monday, February 24, 2014

SQL - கேள்வி பதில் பகுதி - 2

Q 11. Explain what a primary key is, and describe the ideal criteria for a primary key.

A. A primary key is a column or a set of columns that uniquely identify a row in a table. A primary key should be short, stable, and simple.

Q 12. Describe a foreign key and indicate how many foreign keys each table can contain.

A. A foreign key constraint consists of a column or a set of columns that participate in a relationship with a primary key table. The primary key is on the one side of the relationship, whereas the foreign key is on the many side of the relationship. A table can have multiple foreign keys.

Q 13. What is the Tables and Columns specification?

A. The Tables and Columns specifications enable you to designate the foreign key table that will participate in the relationship, the field in the foreign key table that will participate in the relationship, and the field in the current table that will participate in the relationship.

Q 14. Describe three uses of a one-to-one relationship.

A. You use a one-to-one join when the number of fields required for a table exceeds the number of fields allowed in a SQL Server table, when certain fields that are included in a table need to be much more secure than other fields included in the same table, or when several fields in a table are required for only a subset of records in the table.

Q 15. Describe a many-to-many relationship and how you create one.

A. With a many-to-many relationship, records in both tables have matching records in the other table. You cannot create a many-to-many relationship directly. You must develop a junction table and relate the junction table to each of the two tables in one-to-many relationships.

Q16. Why do you use a SELECT statement?

A . You use the SELECT statement to retrieve data from one or more tables.

Q 17. Name the wildcard characters that you can use when searching, and explain the differences between them.

A. The two wildcard characters are the percent (%) sign and the underscore (_). T-SQL uses the percent symbol as the wildcard for zero or more characters. The underscore (_) is the wildcard for a single character.

Q 18. Explain the DISTINCT keyword.

A. The DISTINCT keyword ensures uniqueness of values in the column or combination of columns included in the query result.

Q 19. Why would you use a Top Values query?

A. You use a Top Values query to limit the number of rows that appear in the output.

Q20 Why must you join tables together in a query?

A When you build a system based on normalized table structures, you must join the tables back together to see the data in a useable format.

No comments:

Post a Comment