Database :: All Aptitude Test ::

1.Which of the following fields are displayed as output?
A. Salary, dept_id
B. Employee
C. Salary
D. Salary, dept_id

2.Which of the following employee_id will be displayed for the given query?
A. 1009, 1001, 1018
B. 1009, 1018
C. 1001
D. 1009, 1001, 1018

3.Which of the following statements contains an error?
A. Select * from emp where empid = 10003;
B. Select empid from emp where empid = 10006;
C. Select empid from emp;
D. Select * from emp where empid = 10003;

4.In the given query which of the keyword has to be inserted?
A. Table
B. Values
C. Relation
D. Table

5.Which keyword must be used here to rename the field name?
A. From
B. Rename
C. As
D. From

6.In the SQL given above there is an error . Identify the error.
A. Dept_name
B. Employee
C. “Comp Sci”
D. Dept_name

7.Which one of the following has to be added into the blank to select the dept_name which has Computer Science as its ending string?
A. %
B. _
C. ||
D. %

8.By default, the order by clause lists items in which order?
A. Descending
B. Any
C. Same
D. Descending

9.To display the salary from greater to smaller and name in ascending order which of the following options should be used?
A. Ascending, Descending
B. Asc, Desc
C. Desc, Asc
D. Ascending, Descending

10.In SQL the spaces at the end of the string are removed by function?
A. Upper
B. String
C. Trim
D. Upper

11.Which operator is used for appending two strings?
A. &
B. %
C. ||
D. &

12.What type of statement is this?
A. DML
B. DDL
C. View
D. DML

13.What type of statement is this?
A. DML
B. DDL
C. View
D. DML

14.The basic data type char(n) is a length character string and varchar(n) is length character?
A. Fixed, equal
B. Equal, variable
C. Fixed, variable
D. Fixed, equal

15.To remove a relation from an SQL database, we use the command?
A. Delete
B. Purge
C. Remove
D. Delete

16.This command performs which of the following action?
A. Remove relation
B. Clear relation entries
C. Delete fields
D. Remove relation

17.Updates that violate are disallowed?
A. Integrity constraints
B. Transaction control
C. Authorization
D. Integrity constraints

18.The union operation is represented by?
A.
B. U
C.
D.

19.The intersection operator is used to get the tuples?
A. Different
B. Common
C. Repeating
D. Different

20.The union operation automatically unlike the select clause?
A. Adds tuples
B. Eliminates unique tuples
C. Adds common tuples
D. Adds tuples

21.If we want to retain all duplicates, we must write in place of union?
A. Union all
B. Union some
C. Intersect all
D. Union all

22.What is output of queries which are given below ?
A. Only tuples from second part
B. Only tuples from the first part which has the tuples from second part
C. Tuples from both the parts
D. Only tuples from second part

23.The number of attributes in relation is called as its?
A. Cardinality
B. Degree
C. Tuples
D. Cardinality

24.Which clause is an additional filter that is applied to the result?
A. Select
B. Group-by
C. Having
D. Select

25.Which joins are SQL server default?
A. Outer
B. Inner
C. Equi
D. Outer

26.The is essentially used to search for patterns in target string?
A. Like Predicate
B. Null Predicate
C. In Predicate
D. Like Predicate

27.Which an indicates an absent value that may exist but be unknown or that may not exist at all?
A. Empty tuple
B. New value
C. Null value
D. Empty tuple

28.If the attribute phone number is included in the relation all the values need not be entered into the phone number column. This type of entry is given as?
A. 0
B. _
C. Null
D. 0

29.What is output of given source code?
A. Tuples with null value
B. Tuples with no null values
C. Tuples with any salary
D. Tuples with null value

30.In an 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


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