MCQs SQL Server
MCQs SQL Server
SQL
database
icon with
shortcut
identificati
on (Photo
credit:Wikipe
dia)
A) CREATE PACKAGE
B) CREATE SCHEMA
C) CREATE CLUSTER
A) All of the above
3. Which character function can be used to return a specified portion of a character string?
A) INSTR
B) SUBSTRING
C) SUBSTR
D) POS
B) Drop, Comment
C) Insert, Update, Delete
D) Select, Commit
6. Which is the subset of SQL commands used to manipulate Oracle Database Structures, including tables?
A) Data Definition Language
B) Data Manipulation Language
C) Data Described Language
D) Data Retrieval Language
8. Which of the following SQL command can be used to modify existing data in a database table?
A) MODIFY
B) UPDATE
C) CHANGE
D) NEW
9. When SQL statements are embedded inside 3GL, we call such a program as ..........
A) nested query
B) nested programming
C) distinct query
D) embedded SQL
10. ................ provides option for entering SQL queries as execution time, rather than at the development stage.
A) PL/SQL
B) SQL*Plus
C) SQL
D) Dynamic SQL
Answers:
1. In SQL, which command is used to issue multiple CREATE TABLE, CREATE VIEW and GRANT statements in a single transaction?
B) CREATE SCHEMA
2. In SQL, the CREATE TABLESPACE is used
A) to create a place in the database for storage of scheme objects, rollback segments, and naming the data files to comprise the tablespace.
3. Which character function can be used to return a specified portion of a character string?
C) SUBSTR
4. Which of the following is TRUE for the System Variable $date$?
B) Can be assigned to any field only during design time.
5. What are the different events in Triggers?
C) Insert, Update, Delete
6. Which is the subset of SQL commands used to manipulate Oracle Database Structures, including tables?
A) Data Definition Language
7. The SQL statement SELECT SUBSTR('123456789', INSTR('abcabcabc','b'), 4) FROM EMP; prints
B) 2345
8. Which of the following SQL command can be used to modify existing data in a database table?
B) UPDATE
9. When SQL statements are embedded inside 3GL, we call such a program as ..........
D) embedded SQL
10. ................ provides option for entering SQL queries as execution time, rather than at the development stage.
D) Dynamic SQL
1. ........................ is the full form of SQL.
A) Standard Query Language
B) Sequential Query Language
C) Structured Query Language
D) Server Side Query Language
2. SQL Server 2005 NOT includes the following system database .............
A) tempdb Database
B) Master Database
C) Model Database
D) sqldb Database
3. SQL Server stores index information in the ..................... system table.
A) sysindexes
B) systemindexes
C) sysind
D) sysindexes
4. ..................... is a read-only database that contains system objects that are included with SQL Server 2005.
A) Resource Database
B) Master Database
C) Model Database
D) msdb Database
5. The SQL Server services includes .....................
A) SQL server agent
B) Microsoft distribution transaction coordinator
C) Both a & b
D) None of the above
6. ...................... is a utility to capture a continuous record of server activity and provide auditing capability.
A) SQL server profile
B) SQL server service manager
C) SQL server setup
D) SQL server wizard
7. The query used to remove all references for the pubs and newspubs databases from the system tables is ..........................
A) DROP DATABASE pubs, newpubs;
B) DELETE DATABASE pubs, newpubs;
Answers:
1.
2.
9. When a ................. clause is used, each item in the select list must produce a single value for each group.
A) ORDER BY
B) GROUP
C) GROUP BY
D) GROUP IN
10. MS SQL Server uses a variant of SQL called T-SQL, or Transact SQL, an implementation of .................. with some extensions.
A) MS SQL Server
B) Tabular Data Set
C) SQL-92
D) Tabular Data Stream
3.
Answers:
4.
1. A) Global variables
2. A) One @ symbol
3. A) CHECK, FOREIGN KEY
4. C) Continue, While
5. B) CHECK
6. D) FOREIGN KEY
7. C) IF........ELSE
8. C) Referential integrity
9. C) GROUP BY
10.C) SQL-92
5.
1. Which of the following query is correct for using comparison operators in SQL?
A) SELECT sname, coursename FROM studentinfo WHERE age>50 and <80;
B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;
C) SELECT sname, coursename FROM studentinfo WHERE age>50 and WHERE age<80;
D) None of the above
2.How to select all data from studentinfo table starting the name from letter 'r'?
A) SELECT * FROM studentinfo WHERE sname LIKE 'r%';
B) SELECT * FROM studentinfo WHERE sname LIKE '%r%';
C) SELECT * FROM studentinfo WHERE sname LIKE '%r';
D) SELECT * FROM studentinfo WHERE sname LIKE '_r%';
3. Which of the following SQL query is correct for selecting the name of staffs from 'tblstaff' table where salary is 15,000 or 25,000?
A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);
B) SELECT sname from tblstaff WHERE salary BETWEEN 15000 AND 25000;
C) Both A and B
D) None of the above
4. The SELECT statement, that retrieves all the columns from empinfo table name starting with d to p is ..........................
A) SELECT ALL FROM empinfo WHERE ename like '[d-p]%';
B) SELECT * FROM empinfo WHERE ename is '[d-p]%';
C) SELECT * FROM empinfo WHERE ename like '[p-d]%';
D) SELECT * FROM empinfo WHERE ename like '[d-p]%';
5. Select a query that retrieves all of the unique countries from the student table?
A) SELECT DISTINCT coursename FROM studentinfo;
B) SELECT UNIQUE coursename FROM studentinfo;
C) SELECT DISTINCT coursename FROM TABLE studentinfo;
D) SELECT INDIVIDUAL coursename FROM studentinfo;
6. Which query is used for sorting data that retrieves the all the fields from empinfo table and listed them in the ascending order?
A) SELECT * FROM empinfo ORDER BY age;
B) SELECT * FROM empinfo ORDER age;
C) SELECT * FROM empinfo ORDER BY COLUMN age;
D) SELECT * FROM empinfo SORT BY age;
8. How to Delete records from studentinfo table with name of student 'Hari Prasad'?
A) DELETE FROM TABLE studentinfo WHERE sname='Hari Prasad';
B) DELETE FROM studentinfo WHERE sname='Hari Prasad';
C) DELETE FROM studentinfo WHERE COLUMN sname='Hari Prasad';
D) DELETE FROM studentinfo WHERE sname LIKE 'Hari Prasad';
9. Constraint checking can be disabled in existing ............. and .............. constraints so that any data you modify or add to the table is
not checked against the constraint.
A) CHECK, FOREIGN KEY
B) DELETE, FOREIGN KEY
C) CHECK, PRIMARY KEY
D) PRIMARY KEY, FOREIGN KEY
10. ..................... joins two or more tables based on a specified column value not equaling a specified column value in another table.
A) OUTER JOIN
B) NATURAL JOIN
C) NON-EQUIJOIN
D) EQUIJOIN
6.
Answers:
7.
1. B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;
2. A) SELECT * FROM studentinfo WHERE sname LIKE 'r%';
3. A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);
4. D) SELECT * FROM empinfo WHERE ename like '[d-p]%';
5. A) SELECT DISTINCT coursename FROM studentinfo;
6. A) SELECT * FROM empinfo ORDER BY age;
7. D) INSERT INTO stdinfo VALUES ("15", "Hari Thapa", 45, 5000);
8. B) DELETE FROM studentinfo WHERE sname='Hari Prasad';
9. A) CHECK, FOREIGN KEY
10.C) NON-EQUIJOIN
8.
A) sysindexes
B) systemindexes
C) sysind
D) sysindexes
4. ..................... is a read-only database that contains system objects that are included with SQLServer 2005.
A) Resource Database
B) Master Database
C) Model Database
D) msdb Database
5. The SQL Server services includes .....................
A) SQL server agent
B) Microsoft distribution transaction coordinator
C) Both a & b
D) None of the above
6. ...................... is a utility to capture a continuous record of server activity and provide auditing capability.
A) SQL server profile
B) SQL server service manager
C) SQL server setup
D) SQL server wizard
7. The query used to remove all references for the pubs and newspubs databases from the system tables is ..........................
A) DROP DATABASE pubs, newpubs;
B) DELETE DATABASE pubs, newpubs;
C) REMOVE DATABASE pubs, newpubs;
D) DROP DATABASE pubs and newpubs;
8. ...................... clause specifies the groups into which output rows are to be placed and, if aggregate functions are included in the SELECT clause.
A) ORDER BY
B) GROUP
C) GROUP BY
D) GROUP IN
9. .................. are predefined and maintained SQL Server where users cannot assign or directly change the values.
A) Local Variables
B) Global Variables
C) Assigned Variables
D) Direct Variables
10. Microsoft SQL Server NOT uses which of the following operator category?
A) Bitwise Operator
B) Unary Operator
C) Logical Operator
D) Real Operator
9.
Answers:
10. 1.
2. D) sqldb Database
3. D) sysindexes
4. A) Resource Database
5. C) Both a & b
6. B) SQL server service manager
7. A) DROP DATABASE pubs, newpubs;
8. C) GROUP BY
9. B) Global Variables
10.D) Real Operator
11. 1. The attribute .................. of <BODY> tag sets color of hypertext links.
A) link
B) vlink
C) alink
D) hlink
2. Default font size of HTML is .......................
A) 2
B) 4
C) 6
D) 3
3. This is a networking device that passes data between networks having similar functions but dissimilar implementations.
A) Hub
B) Modem
C) Gateway
D) Repeater
4. In order to connect to ISP's server you need .......
A) Hand gloves
B) Printer
C) User name and Password
D) None of the above
5. DNS translates .........
A) domain name into IP
12.
Answers:
13.
1. A) link
2. D) 3
3. C) Gateway
4. C) User name and Password
5. C) both a & b
6. D) FTP
7. D) Institute of electrical and electronics engineers
8. A) Backbone
9. A) Packets
10. D) Tim Berners-Lee
14. 1. Which if the following is/are the levels of implementation of data structure
A) Abstract level
B) Application level
C) Implementation level
D) All of the above
2. A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called
A) AVL tree
B) Red-black tree
C) Lemma tree
D) None of the above
3. .. level is where the model becomes compatible executable code
A) Abstract level
B) Application level
C) Implementation level
D) All of the above
4. Stack is also called as
A) Last in first out
B) First in last out
B) Records
C) Pointers
D) Stacks
13. A ....... is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
A) Queue linked list
B) Stacks linked list
C) Both of them
D) Neither of them
14. Which of the following is non-liner data structure?
A) Stacks
B) List
C) Strings
D) Trees
15. Herder node is used as sentinel in .....
A) Graphs
B) Stacks
C) Binary tree
D) Queues
16. Which data structure is used in breadth first search of a graph to hold nodes?
A) Stack
B) queue
C) Tree
D) Array
17. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
A) Input restricted dequeue
B) Output restricted qequeue
C) Priority queues
D) Stack
18. Which of the following data structure is non linear type?
A) Strings
B) Lists
C) Stacks
D) Graph
19. Which of the following data structure is linear type?
A) Graph
B) Trees
C) Binary tree
D) Stack
20. To represent hierarchical relationship between elements, Which data structure is suitable?
A) Dequeue
B) Priority
C) Tree
D) Graph
15. Answers:
16.
6. Centralizing the integrity checking directly under the DBMS .. Duplication and ensures the consistency and validity of the database.
A) Increases
B) Skips
C) Does not reduce
D) Reduces
7. Which of the following is/are the DDL statements?
A) Create
B) Drop
C) Alter
D) All of the above
8. In snapshot, . clause tells oracle how long to wait between refreshes.
A) Complete
B) Force
C) Next
D) Refresh
9. defines rules regarding the values allowed in columns and is the standard mechanism for enforcing database integrity.
A) Column
B) Constraint
C) Index
D) Trigger
10. For like predicate which of the following is true.
i) % matches zero of more characters.
ii) _ matches exactly one character.
A) i-only
B) ii-only
C) Both of them
D) None of them
18.
19. Answers:
22. Answers:
23. 1. A) Subset of X
2. C) DDL
3. C) Both of them
4. B) Random access
5. A) Delete * from table_name
6. A) Key integrity
7. B) Fourth Normal Form
8. B) Backup Utility
9. C) Terminal Interface
10. D) Fourth Normal Form
25.
Answers:
26. 1.
2.
3.
4.
5.
6.
7.
8.
9. B) Global Variables
10.D) Real Operator