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 ASP.NET with SQL Server

  1. A primary key should be created for the customer_id field in the customer table and also for the customer_id field in the order table.

  2. A primary key should be created for the order_id field in the customer table and also for the customer_id field in the order table

  3. A primary key should be created for the customer_id field in the customer table and a foreign key should be created for the customer_id field in the order table

  4. A primary key should be created for the customer_id field in the customer table and a foreign key should be created for the order_id field in the order table

  5. None of these  

Answer: Answer is c

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.


STUDENT_ID        INT 
SEMESTER_END        DATETIME 
GPA                FLOAT 

Which of the following statements finds the highest Grade Point Average (GPA) per semester?

  1. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL

  2. SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL

  3. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end

  4. SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades

  5. SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL

Answer: Answer is c

  1. DataRow

  2. DataSet

  3. DataTable

  4. DataReader

Answer: Answer is d

  1. customers( customer_id, customer_name)
  2. branch ( branch_id, branch_name )

What will be the output if the following query is executed:

Select *, branch_name from customers,branch

  1. It will return the fields customer_id, customer_name, branch_name

  2. It will return the fields customer_id, customer_name, branch_id, branch_name

  3. It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name

  4. It will return an empty set since the two tables do not have any common field name

  5. It will return an error since * is used alone for one table only

Answer: Answer is c

  1. Select * from Products order by CurrentStock,ProductGroup

  2. Select * from Products order by CurrentStock DESC,ProductGroup

  3. Select * from Products order by ProductGroup,CurrentStock

  4. Select * from Products order by ProductGroup,CurrentStock DESC

  5. None of the above

Answer: Answer is d

  1. UPDATE Persons SET LastName = 'Nilsen' WHERE LastName = 'Hansen'

  2. UPDATE Persons SET LastName = 'Hansen' INTO LastName = 'Nilsen'

  3. SAVE Persons SET LastName = 'Nilsen' WHERE LastName = 'Hansen'

  4. SAVE Persons SET LastName = 'Hansen' INTO LastName = 'Nilsen'

Answer: Answer is a
Further Reading:

Useful resources, SQL UPDATE Statement


rollno        int 
name          varchar(20) 
course        varchar(20) 

What will be the query to display the courses in which the number of students enrolled is more than 5?

  1. Select course from students where count(course) > 5;

  2. Select course from students where count(*) > 5 group by course;

  3. Select course from students group by course;

  4. Select course from students group by course having count(*) > 5;

  5. Select course from students group by course where count(*) > 5;

  6. Select course from students where count(group(course)) > 5;

  7. Select count(course) > 5 from students;

  8. None of the above

Answer: Answer is d

select empno, DISTINCT ename, Salary from emp;

  1. EMPNO, unique value of ENAME and then SALARY are displayed

  2. EMPNO, unique value ENAME and unique value of SALARY are displayed

  3. DISTINCT is not a valid keyword in SQL

  4. No values will be displayed because the statement will return an error

Answer: Answer is d

  1. SELECT * FROM myTable WHERE column1 is null

  2. SELECT * FROM myTable WHERE column1 = null

  3. SELECT * FROM myTable WHERE column1 EQUALS null  

  4. SELECT * FROM myTable WHERE column1 NOT null  

  5. SELECT * FROM myTable WHERE column1 CONTAINS null

Answer: Answer is a

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.

;