Database :: All Aptitude Test ::

1.Choose the most suitable data type in case multiple data types are possible for the column.Column Name: Date_Of_Birth ; Description: Date of Birth of the employee ; Example: 1990/01/01 :
A. Timestamp
B. VARCHAR2(11)
C. Blob
D. Timestamp

2. SQL allows comparison operations on the data types i.e.
A. Date
B. Timestamp
C. Time
D. Date

3.Choose a data type to store weight of a person in kilograms with accuracy of 1 gram. As per wikipedia, Jon Brower Minnoch was the heaviest human ever recorded with a weight of 635kg.
A. NUMBER(3,3)
B. NUMBER(3,2)
C. NUMBER(6,2)
D. NUMBER(3,3)

4.This set of Database Questions & Answers focuses on “SQL Data Types and Schemas” Dates must be specified in the format :
A. mm/dd/yy
B. yyyy/mm/dd
C. dd/mm/yy
D. mm/dd/yy

5.Values of one type can be converted to another domain using which of the following ?
A. Cast
B. Drop type
C. Alter type
D. Cast

6.Many current-generation database applications need to store photographs, or of the order megabytes and gigabytes using :
A. Large-index type
B. Large-object type
C. Large-location type
D. Large-index type

7.Current date is returned by the method :
A. system.date
B. current.date
C. machine.date
D. system.date

8.Data types in SQL Server are organized into how many categories?
A. 6
B. 7
C. 8
D. 6

9.An index helps to speed up?
A. SELECT queries
B. WHERE clauses
C. Both A and B
D. SELECT queries

10.Which of the following is correct CREATE INDEX Command?
A. INSERT INDEX index_name ON table_name;
B. INSERT INDEX index_name ON database_name;
C. CREATE INDEX index_name ON database_name;
D. INSERT INDEX index_name ON table_name;

11. A _______ index is an index on two or more columns of a table.
A. Implicit
B. Unique
C. single-column
D. Implicit

12. To combine multiple retrievals, we write several SELECT statements and put the keyword between them. What is the keyword?
A. COMBINE
B. CONCAT
C. JOIN
D. COMBINE

13. What is xyz in the following SQL statement? SELECT xyz FROM table1 UNION xyz FROM table2;
A. row name
B. column name
C. table name
D. row name

14.Which of the following statements are TRUE regarding subqueries?
A. A subquery can retrieve zero or more rows
B. A subquery can appear on either side of a comparison operator
C. There is no limit on the number of subquery levels in the WHERE clause of a SELECT statement
D. A subquery can retrieve zero or more rows

15.Which of the following statement(s) is TRUE regarding subqueries?
A. Inner queries in WHERE clause can contain ORDER BY
B. Outer query and inner query can get data from different tables
C. Outer query and inner query must get data from the same table
D. Inner queries in WHERE clause can contain ORDER BY

16.Which ACID property specifies that once the transaction is committed, its permanent even in case of power failures?
A. Atomicity
B. Consistency
C. Isolation
D. Atomicity

17. Where subqueries can not be used?
A. Field names in the SELECT statement
B. The WHERE clause only in the SELECT statement
C. The WHERE clause in SELECT as well as all DML statements
D. Field names in the SELECT statement

18.Select * from student join takes using (ID); The above query is equivalent to ____________?
A. Select * from student inner join takes using (ID);
B. Select * from student outer join takes using (ID);
C. Select * from student left outer join takes using (ID);
D. Select * from student inner join takes using (ID);

19.The ______ construct returns true if a given tuple is present in the subquery.
A. not exists
B. present
C. not present
D. not exists

20.NULL is :
A. the same as 0 for integer
B. the same as blank for character
C. the same as 0 for integer and blank for character
D. the same as 0 for integer

21.The predicate in a where clause can involve Boolean operations such as and.The result of true and unknown is_______ false and unknown is _____ while unknown and unknown is _____?
A. Unknown, unknown, false
B. True, false, unknown
C. True, unknown, unknown
D. Unknown, unknown, false

22.This SQl query selects :
A. Tuples with null value
B. Tuples with no null values
C. Tuples with any salary
D. Tuples with null value

23.In a employee table to include the attributes whose value always have some value which of the following constraint must be used ?
A. Null
B. Not null
C. Unique
D. Null

24.Using the ______ clause retains only one copy of such identical tuples.
A. Null
B. Unique
C. Not null
D. Null

25.Some of these insert statements will produce an error. Identify the statement.
A. Insert into employee values (1005,Rach,0);
B. Insert into employee values (1002,Joey,335);
C. Insert into employee values (1007,Ross, );
D. Insert into employee values (1005,Rach,0);

26.You attempt to query the database with this command:
A. The expression attempts to divide by a null value
B. The data types in the conversion function are incompatible
C. The character string none should be enclosed in single quotes (‘ ‘)
D. The expression attempts to divide by a null value

27.The result of _____unknown is unknown.
A. Xor
B. Or
C. And
D. Xor

28.Aggregate functions are functions that take a ___________ as input and return a single value.
A. Collection of values
B. Single value
C. Aggregate value
D. Collection of values

29.If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.
A. Distinct
B. Count
C. Avg
D. Distinct

30.A Boolean data type that can take values true, false, and________?
A. 1
B. 0
C. Null
D. 1


Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers