Database :: All Aptitude Test ::

1.Which of the following is a legal expression in SQL?
A. SELECT NULL FROM SALES;
B. SELECT NAME FROM SALES;
C. SELECT * FROM SALES WHEN PRICE = NULL;
D. SELECT NULL FROM SALES;

2.DCL provides commands to perform actions like:
A. Change the structure of Tables
B. Insert, Update or Delete Records and Values
C. Authorizing Access and other control over Database
D. Change the structure of Tables

3.The COUNT function in SQL returns the number of ______________?
A. Values
B. Distinct values
C. Group By
D. Values

4.Which data type can store unstructured data in a column?
A. RAW
B. CHAR
C. NUMERIC
D. RAW

5.Which function is used to divides one numeric expression by another and get the remainder ?
A. POWER
B. MOD
C. ROUND
D. POWER

6. In a sql subquery , which operator is used to check for existence of record ?
A. SQL NOT NULL
B. SQL AS
C. SQL EXISTS
D. SQL NOT NULL

7. Correct SQL query syntax to update a record from a table is :
A. UPDATE table_name SET column1 = value1, column2 = value2, … WHERE condition;
B. UPDATE table_name SET COLUMN column1 = value1, column2 = value2, … WHERE condition;
C. UPDATE table_name UPDATE column1 = value1, column2 = value2, … WHERE condition;
D. UPDATE table_name SET column1 = value1, column2 = value2, … WHERE condition;

8.Which is called as a virtual table in SQL?
A. INNER JOIN
B. JOIN
C. VIEW
D. INNER JOIN

9.To specify the number of records to return, which keyword is used :
A. FIRST
B. TOP
C. START
D. FIRST

10.To search for a specified pattern in a column :
A. SQL MATCH
B. SQL LIKE
C. SQL PATTERN
D. SQL MATCH

11.Which clause is used to combine rows from two or more tables based on a related column between them.
A. SQL MATCH
B. SQL JOIN
C. SQL PATTERN
D. SQL MATCH

12.To combine the result-set of two or more SELECT statements, SQL clause used is :
A. SQL UNION
B. SQL JOIN
C. SQL GROUP BY
D. SQL UNION

13.In a table, a column contains duplicate value, if you want to list all different value only, then which SQL clause is used?
A. SQL DISTINCT
B. SQL UNIQUE
C. SQL BETWEEN
D. SQL DISTINCT

14.To give a temporary name to a table, or a column in a table for more readability, what is used?
A. SQL Wildcards
B. SQL aliases
C. SQL LIKES
D. SQL Wildcards

15.Logical operators used in SQL are :
A. AND, OR , NOT
B. &&, ||, !
C. $,|,!
D. AND, OR , NOT

16.Select name from instructor where dept name = ’Physics’ order by name; By default, the order by clause lists items in ______ order.
A. Descending
B. Any
C. Same
D. Descending

17.Select * from instructor order by salary ____, name ___; 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

18.Select emp_name from department where dept_name like ’ _____ Computer Science’; Which one of the following has to be added into the blank to select the dept_name which has Computer Science as its
A. %
B. _
C. ||
D. %

19._____ operator is used for appending two strings.
A. &
B. %
C. ||
D. &

20.Select * from instructor order by salary ____, name ___; To display the salary from greater to smaller and name in ascending order which of the following options should be used ?
A. UPDATE empdet SET ename = 'Amit' WHERE empno = 1234;
B. DELETE FROM empdet WHERE ename LIKE 'J%';
C. CREATE VIEW empvu AS SELECT* FROM empdept;
D. UPDATE empdet SET ename = 'Amit' WHERE empno = 1234;

21.A non-correlated subquery can be defined as________?
A. A set of sequential queries, all of which must always return a single value
B. A set of sequential queries, all of which must return values from the same table
C. A SELECT statement that can be embedded in a clause of another SELECT statement only
D. A set of sequential queries, all of which must always return a single value

22.Which statements are correct regarding indexes?
A. When a table is dropped, the corresponding indexes are automatically dropped
B. For each DML operation performed, the corresponding indexes are automatically updated
C. A non-deferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically creates a unique index
D. When a table is dropped, the corresponding indexes are automatically dropped

23.OE and SCOTT are the users in the database. The ORDERS table is owned by OE. Evaluate the statements issued by the DBA in the following sequence:
A. SCOTT would be able to query the OE.ORDERS table
B. SCOTT would not be able to query the OE.ORDERS table
C. The REVOKE statement would remove the SELECT privilege from SCOTT as well as from the role R1
D. SCOTT would be able to query the OE.ORDERS table

24. Evaluate the following statements:
A. It would not display any values
B. It would display the value TWO once
C. It would display the value TWO twice
D. It would not display any values

25.The deadlock in a set of a transaction can be determined by :
A. Read-only graph
B. Wait graph
C. Wait-for graph
D. Read-only graph

26.A deadlock exists in the system if and only if the wait-for graph contains a ___________?
A. Cycle
B. Bi-direction
C. Rotation
D. Cycle

27. A system is in a ______ state if there exists a set of transactions such that every transaction in the set is waiting for another transaction in the set.
A. Idle
B. Deadlock
C. Ready
D. Idle

28. In crabbing protocol locking :
A. Goes down the tree and back up
B. Goes up the tree and back down
C. Goes down the tree and releases
D. Goes down the tree and back up

29.Which SQL function is used to count the number of rows in a SQL query?
A. COUNT()
B. NUMBER()
C. SUM()
D. COUNT()

30.Which SQL keyword is used to retrieve a maximum value?
A. MOST
B. TOP
C. MAX
D. MOST


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