Professional Documents
Culture Documents
SQL Test
SQL Test
A. DECIMAL
B. NUMERIC
C. FLOAT
D. CHARACTER
2. A company has a SQL Server database instance that hosts a database named
ComDB. The ComDB database has a table named Partners that was created using the
following Transact-SQL code:
You want to create a FOR UPDATE trigger that will track changes to the ContactName
and Phone columns. Which of the following statements should you use in the trigger
definition?
3. You are the database administrator of a SQL Server database infrastructure in one company.
You need to optimize a very large database table that contains several million rows of data by
designing a view based on the table. The view must allow users to perform aggregations on
several columns.
You develop a new table named Events using the following Transact-SQL code:
5. You work as a SQL Server database developer. Your company has a database named
SalesDB. You are developing a stored procedure that takes a parameter named @date that
uses the varchar datatype. The @date parameter must be compared to the value in a
datetime column named OrderDate. Which of the following WHERE clauses would be the
most efficient WHERE clause to use?
Company has retail stores in a few major cities across the country. The company
wants a list of Customers who live in a city that does not have a there store, along with
the customer's City. The result set must be sorted alphabetically by City name.
Which of the following Transact-SQL statements would return the required information?
3|Page
A. TRUE
B. FALSE
9. You work as a database developer. Your company has a SQL Server database named
SalesDB that has a table named Inventory.
The Inventory table has three columns named ProductID, InStore and InWarehouse. The
ProductID column is the primary key and is linked to the Products table.
The InStore column stores the quantity of a product that is held in company’s retail shop, while
the InWarehouse column stores the quantity of a product that is held at company’s
warehouse. You need to add a computed column that is the sum of values in the InStore and
InWarehoue columns for each product.
What Transact SQL statement would accomplish this task?
4|Page
11. Which of the following statements is true concerning routines and triggers?
12. The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID,
ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T WHERE
CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID
A. Equi-join
B. Natural join
C. Outer join
D. Cartesian join
13. You work as a SQL Server database developer. Your company has a database named
SalesDB with tables named Customer and Orders. The Customer and Orders tables were
created using the following Transact-SQL code:
5|Page
B. Combines the output from no more than two queries and does not include the same
number of columns.
C. Combines the output from multiple queries and must include the same number of
columns. D. Combines the output from multiple queries and does not include the same
number of columns.
6|Page
inner query. C. Uses the result of an inner query to determine the processing
17. When AUTOCOMMIT is set on, changes will be made automatically at the end of
each SQL statement.
A. True
B. False
19. Construct that a recursive query should not use on recursive view, is
A. Aggregation
B. Unions
C. Comparisons
D. Booleans
7|Page
A. Rows
B. Attributes
C. Relationship
D. Actual data
21. A query string can be constructed and prepared at runtime, using a statement of form
A. EXEC PREP
B. EXEC SQL PREPARE
C. SQL PREPARE
D. EXEC DEFINE PREPARE
22. For fixed-length types such as integer or float, maximum length field is
A. Accepted
B. Allotted
C. Ignored
D. Implemented
A. Distinctive
B. Unique
C. Distinct
D. Different
A. Top
B. Most
C. Upper
D. Max
A. While statement
B. From statement
C. Where statement
8|Page
D. When statement
26. To define a temporary view whose definition is available only to query in which it is
defined, clause used is
A. Declare clause
B. With clause
C. Define clause
D. While clause
A. sort by
B. having by
C. order by
D. sequence by
A. Nonprocedural extension
B. Procedural extension
C. Structured extension
D. Nonstructured extension
9|Page