Databases Questions & Answers
1. What Are Two Methods of RetrieVing SQL? Answer:
2. What Cursor Type Do You Use to Retrieve Multiple RecordSets? Answer:
3. What action do you have to perform before retrieving data from the next result set of a stored procedure Answer:? Move the cursor down one row from its current position A ResultSet cursor is initially positioned before the first row Before you can get.. to the first row, you would need to Move the cursor down by one row (For ex: in java the first call to next makes the first row the current row; the second call makes the second row the current row, and so on) .
4. What is The Basic Form of a SQL STATEMENT TO READ DATA OUT OF A TABLE? ANSWER: SELECT * from Table_Name
5. What structure can you have the database make to speed up table reads Answer:? The question is not correct "What structure can you have the database make to speed up table reads?" It is not clear what exactly the term "structure. "means in this case Follow the rules of tuning we have DB to:. 1) properly use indexes (different types of indexes) 2) properly locate different DB objects across different tablespaces, files and so on.3) Create a special space ( TABLESPACE) To Locate Some of The Data with Special Dattypes (for Example Clob, LOB and ...) 4) ... 5) ...
6. What is a "join"? Answer: Joins Merge The Data of Two Related Tables Into a Single Result Set, Presenting a DenorMalized View of The Data.
7. What is a "constraint" Answer: A constraint allows you to apply simple referential integrity checks to a table There are 5 primary types of constraints that are currently supported by SQL Server:?. PRIMARY / UNIQUE - enforces uniqueness of a particular table column.DEFAULT - specifies a default value for a column in case an insert operation does not provide one.FOREIGN KEY - validates that every value in a column exists in a column of another table.CHECK - checks that every value stored in a column is . in some specified list nOT nULL - is a constraint which does not allow values in the specific column to be null And also it is the only constraint which is not a table level constraint.8 What is a "primary key" Answer:.? Primary key is a type of a constraint enforcing UNIQUESS AND DATA INTEGRITY for Each Row Of A Table. All columns participating in a primary key constraint Must Possess The Not Null Property.
9. What is a "functional dependency" How does it relate to database table design Answer:?? What functional dependence in the context of a database means is that: Assume that a table exists in the database called TABLE with a composite primary key ( A, B) AND Other NON-Key Attributes (C, D, E). Functional Dependency In General, Would Mean That Any Non-Key Attribute - CD OR E Being Dependent ON The Primary Key (a and b) in Our Table Here ............................................................................................................................................................................ Whole. EXAMPLE: ---------- Fully Functional Dependent: CDE -> A BPARTIAL FUNCTIONAL DepENDENCY: C -> A, DE -> Bhope That Helps! 10. What is a "TRIGGER"? Answer: a Trigger is a database Object Directly Associated with a particular table. It Fires WHENEVER A Specific Statement / Type Of Statement Is Issued Against Table. The Types of statements are insert, update, delete and query statements. Basically, trigger is a set of SQL statements that execute in response to a data modification / retrieval event on a table.Other than table triggers there are also schema and database triggers. These can be made to fire when new objects are created, when a user logs in, when the database shutdown etc. Table level triggers can be classified into row and statement level triggers and those can be further broken down into before and after triggers. Before triggers can Modify Data.
11. What is "index covering" of a query Answer:? A nonclustered index that includes (or covers) all columns used in a query is called a covering index When SQL server can use a nonclustered index to resolve the query, it will. prefer to scan the index rather than the table, which typically takes fewer data pages. If your query uses only columns included in the index, then SQL server may scan this index to produce the desired output.