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

  1. primary query -> sub query -> sub sub query and so on

  2. sub sub query -> sub query -> prime query

  3. the whole query is interpreted at one time

  4. there is no fixed sequence of interpretation, the query parser takes a decision on the fly

Answer: Answer is b
Further Reading:

Primary query results depend on the sub query results, so sub query my execute first then primary query will execute.   Useful resources, Subquery Fundamentals


Books

------

BookId

BookName

AuthorId

SubjectId

PopularityRating       (the popularity of the book on a scale of 1 to 10)

Language               (such as French, English, German etc)

Subjects

---------

SubjectId

Subject   (such as History, Geography, Mathematics etc)

Authors

--------

AuthorId

AuthorName

Country

What is the query to determine the names of the Authors who have written more than 1 book?

  1. select AuthorName from Authors where AuthorId in

         (select AuthorId from Books group by AuthorId having count(*)>1)

  2. select AuthorName from Authors, Books

         where Authors.AuthorId=Books.AuthorId and count(BookId)>1

  3. select AuthorName from Authors, Books

         where Authors.AuthorId=Books.AuthorId

         group by AuthorName having count(*)>1

  4. select AuthorName from Authors where AuthorId in

         (select AuthorId from Books having count(BookId)>1)

Answer: Answer is a, c
Further Reading:

Useful resources, GROUP BY,SQL basic queries, query fundamental, HAVING Clause, COUNT, SQL IN


Marketing, Designing, production, Packing

What will be the result of the following query?

select * from table where department < 'marketing';
  1. The query will return "Designing, Packing"

  2. The query will return "Designing, production, Packing"

  3. The query will return "packing"

  4. Strings cannot be compared using < operator

  5. The query will return "Designing"

Answer: Answer is e

Books

------

BookId

BookName

AuthorId

SubjectId

PopularityRating       (the popularity of the book on a scale of 1 to 10)

Language               (such as French, English, German etc)

 

 

Subjects

---------

SubjectId

Subject   (such as History, Geography, Mathematics etc)

 

 

Authors

--------

AuthorId

AuthorName

Country

What is the query to determine how many books, with a popularity rating of more than 7, have been written on each subject?

  1. select subject,count(*) as Books from books,subjects

           where books.popularityrating > 7

           group by subjects.subject

  2. select subject,count(*) as Books from books,subjects

           where books.authorid=subjects.authorid and books.popularityrating > 7

           group by subjects.subject

  3. select subject,count(*) as Books from books,subjects

           where books.subjectid=subjects.subjectid and books.popularityrating = 7

           group by subjects.subject

  4. select subject,count(*) as Books from books,subjects

           where books.subjectid=subjects.subjectid and books.popularityrating > 7

           group by subjects.subject

Answer: Answer is a

  1. Select
  2. order by
  3. where
  4. having
  5. group by
  1. 1,2,3,4,5

  2. 1,3,5,4,2

  3. 1,3,5,2,4

  4. 1,3,2,5,4

  5. 1,3,2,4,5

  6. 1,5,2,3,4

  7. 1,4,2,3,5

  8. 1,4,3,2,5

Answer: Answer is b
Further Reading:

The order should be like this select>where>group by>having>order by. Useful resources, SQL basic queries, query fundamental, HAVING Clause


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

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

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.

;