SQL Server and Sybase ASE Database Concepts
Covers triggers, stored procedures, transactions, joins, subqueries, and SQL Server administration topics
Questions
Which of the below commands is used to find more information about the SQL Server installed such as edition, product level etc. ?
- Select * from sys.servers
- sp_get_serverinfo
- select @@version
- sp_serverproperty
What is ACID property?
- Atomicity,Concurrently,Isolation,Durability
- Atomicity,Consistency,Incremental,Durability
- Atomicity,Consistency,Isolation and Durability
- Atomicity,Concurrently,Incremental,Durability
Identity is a column that automatically generates numeric values.
- True
- False
Which of the following are different locks in SQL SERVER?
- Intent
- Shared
- Exclusive
- Delete
Which of the following are different Isolation levels in SQL Server?
- Read Uncommitted
- Read Committed
- Serializable
- Repeatable Read
Linked Servers cannot be created to SQL and Non-SQL data sources such as Oracle, MySQL, Sybase etc.
- True
- False
Which of the following is a SQL Server 2005 Build number?
- 10.5.1702
- 8.00.223
- 9.00.4285
- 7.00.1152
Which of the following statements about subqueries are true? (Choose 3)
- Subqueries can have up to 16 levels of nesting
- Subqueries can have up to 50 levels of nesting
- Subqueries returning only one row can follow “=” in a WHERE clause
- Subqueries returning only one row can follow “IN” in a WHERE clause
For which of the following queries may a merge join be considered?
- Outer joins
- Multi-table updates and deletes
- Equi-joins
- Equi-join with a text column in select list
A UNION of two or more queries is valid provided the queries meet which of the following conditions? (Choose 3)
- All select lists in the UNION must have the same number of expressions
- Corresponding columns must have the same column names
- Corresponding columns must be of the same datatype or the server must be able to implicitly convert them
- Corresponding columns must be in the same order
Choose the correct statements about the union clause in ASE (Choose 2)
- Duplicate rows are removed from the result set by default
- ASE evaluates a statement containing union operators from left to right
- Order by and group by clauses are not allowed in a union query
- The into clause can be used only in the first query
Which of the following are true about triggers? (Choose 2)
- the inserted and deleted tables are created manually
- triggers can be disabled using alter table
- a single trigger can be created for both insert and delete
- @@sqlstatus contains the number of rows affected
Table t and trigger trig are created as follows: create table t (a int) go create trigger trig on t for insert, update, delete as begin if @@rowcount > 1 rollback trigger end go The following transaction is now executed: begin tran insert t values (1) insert t values (2) insert t select * from t insert t values (3) commit go After completing this transaction, how many rows will table t contain?
- 0
- 1
- 2
- 3
Which T-SQL elements can be used in a stored procedure? (Choose 2)
- 'return', without a return value
- 'rollback transaction'
- 'rollback trigger'
- the built-in function 'update()'
Which ASE table contains the source code of a stored procedure?
- sysprocedures
- syscomments
- syslogs
- systext
What is the maximum number of characters that can be passed to a stored procedure through a single char or varchar parameter without being truncated?
- 127
- 255
- 16384
- equal to the server page size
The following trigger exists: create trigger trig on t for insert, update, delete as begin print 'This is 'trig' ' end The following command is now executed: create trigger trig on t for insert as begin print 'This is 'trig' ' end After executing this command, for which DML actions on table 't' will a trigger be fired?
- insert
- update
- insert, update, delete
- delete,update
Creation of which DB objects will cause a DDL trigger to fire?
- Index
- Cluster
- Package
- DB links
- Function
A call statement inside the trigger body enables you to call:
- Package
- Function
- Procedure
- Another DB trigger
What part of a DB trigger determines the number of times a trigger body executes?
- Trigger type
- Trigger body
- Trigger event
- Trigger timing