News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Online Test MS SQL Server 2000

CREATE TABLE Orders (         

OrderID Int IDENTITY NOT NULL,        

 SalesPersonID Int NOT NULL,        

 RegionID Int NOT NULL,         

OrderDate Datetime NOT NULL,         

OrderAmount Int NOT NULL )

Which statement will produce the report correctly?

  1. SELECT TOP 5 OrderAmount, SalesPersonID FROM orders

  2. SELECT TOP 5 OrderAmount, SalesPersonID FROM orders ORDER BY OrderAmount DESC

  3. SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders

  4. SELECT TOP 5 WITH TIES OrderAmount, SalesPersonID From Orders ORDER BY OrderAmount

Answer: Answer is b
Further Reading:

The company need the highest sate amount. So we need to order amount in DESC order. Useful resources, TOP, WITH TIES


  1. Null

  2. Not Null

  3. Default

  4. Identity

Answer: Answer is c
Further Reading:

Useful resources, COLUMNPROPERTY


Begin Transaction
      Create table A ( x smallint, y smallint)
      Create table B ( p smallint, q smallint)

        Update A set x=600 where y > 700
        Update B set p=78 where q=99

          If @@ error != 0
          Begin
          RollBack Transaction
            Return 
          End

     Commit Transaction

Select the correct option:

  1. The transaction will work perfectly fine

  2. It will report an error

  3. The error handling routine contains a syntax error

  4. None of the above

  5. Both b and c

Answer: Answer is b
Further Reading:

It will report an error, because there is a space between @@ and error.


Sample Code

CREATE TABLE table1(

column1 varchar(50),

column2 varchar(50),

column3 varchar(50),

column4 varchar(50));

Which one of the following is the correct syntax for adding the column named "column2a" to the table shown above?

  1. ALTER TABLE table1 ADD column2a varchar(50);

  2. MODIFY TABLE table1 ADD column2a;

  3. INSERT INTO table1 column2a AS varchar(50);

  4. ALTER TABLE table1 INSERT column2a varchar(50);

  5. CHANGE TABLE table1 INSERT column2a;

Answer: Answer is a

  1. BLOB

  2. VARCHAR

  3. TEXT

  4. VARTEXT

Answer: Answer is d

  1. trim() function is used to remove leading and trailing spaces from a string

  2. ltrim() function is used to remove leading spaces from a string

  3. rtrim() function is used to remove trailing spaces from a string

  4. alltrim() function is used to remove leading and trailing spaces from a string

Answer: Answer is a, d

  1. Binary Large Object

  2. Binary Lower Byte

  3. Bit Large Object

  4. Bit Lower Byte

Answer: Answer is a

  1. The increment parameter can never be negative

  2. The increment can be 0

  3. More than one columns in a table can be assigned the identity property

  4. The identity property value for a column assures uniqueness of a row

  5. None of the above

Answer: Answer is e

  1. Yes

  2. No

Answer: Answer is b
Further Reading:

In the SELECT statement, the FROM clause is required except when the select list contains only constants, variables, and arithmetic expressions (no column names). Useful resources, FROM


SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000

Which of the following statements is correct with regard to this code?

  1. It returns employees whose salary is 50% more than $23,000

  2. It returns employees who have 50% commission rate or salary greater than $23,000

  3. It returns employees whose salary is 50% less than $23,000

  4. None of the above

Answer: Answer is b
Further Reading:

Useful resources, SQL basic queries, query fundamental


Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;