Database Test Part-01

 

1. What will the output be if you try to perform arithmetic on NULL values?

  1. 0
  2. NULL
  3. It will generate an error message
  4. Can’t be determined

2. Which of the following options is not correct about the DATEDIFF() function?

  1. It returns the difference between parts of two specified dates
  2. It takes three arguments
  3. It returns a signed integer value equal to second date part minus first date part
  4. It returns a signed integer value equal to first date part minus second date part

3. 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” after column2 to the table shown above?

  1. ALTER TABLE table1 ADD column2a varchar(50) AFTER column2;
  2. MODIFY TABLE table1 ADD column2a AFTER column2;
  3. INSERT INTO table1 column2a AS varchar(50) AFTER column2;
  4. ALTER TABLE table1 INSERT column2a varchar(50) AFTER column2;
  5. CHANGE TABLE table1 INSERT column2a BEFORE column3;

4. State which of the following are true

  1. Views are a logical way of looking at the logical data located in the tables
  2. Views are a logical way of looking at the physical data located in the tables
  3. Tables are physical constructs used for storage and manipulation of data in databases
  4. Tables are logical constructs used for storage and manipulation of data in databases

5. Which of the following is not a valid binary datatype in SQL Server?

  1. BINARY
  2. VARBINARY
  3. BIT
  4. IMAGE
  5. TESTAMP

6. Which of the following is false with regards to sp_help?

  1. When a procedure name is passed to sp_help, it shows the parameters
  2. When a table name is passed to sp_help, it shows the structure of the table
  3. When no parameter is passed, it provides a list of all objects and user-defined datatypes in a database
  4. All of the above are true

7. Which of the following is not a numeric group function?

  1. Avg
  2. Count
  3. Highest
  4. Max
  5. Stdev
  6. Sum

8. What clause should be used to display the rows of a table in ascending order of a particular column?

  1. Where
  2. Order By
  3. Group By
  4. Having
  5. First Group By and then Having
  6. Like
  7. Between

9. _________ is the operation that displays certain columns from the table.

  1. Restriction
  2. Intersection
  3. Join
  4. Union
  5. Projection
  6. Selection
  7. Extraction
  8. SubQuery

10. Consider the following tables: Books —— BookId BookName AuthorId SubjectId PopularityRating (the popularity of the book ON a scale of 1 TO 10) Languagе (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 which German books(if any) are more popular than all the French?

  1. select bookname from books where language=’German’ and popularityrating = (select popularityrating from books where language=’French’)
  2. select bookname from books where language=’German’ and popularityrating> (select popularityrating from books where language=’French’)
  3. select bookname from books where language=’French’ and popularityrating> (select max(popularityrating) from books where language=’German’)
  4. select bookname from books where language=’German’ and popularityrating> (select max(popularityrating) from books where language=’French’)

Comments

comments

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.