You are on page 1of 3

Marks: 58 (20 + 10 + 10 + 18)

Name: ________________________________________________ Obtained Marks: _________________


1. Which clause of a SELECT statement is required? a. SELECT b. FROM c. WHERE d. ORDER BY
2. Which clause of a SELECT statement is used to filter rows? a. SELECT b. FROM c. WHERE d. ORDER BY
3. Which one correctly defines the predicates in SELECT query?
a. The table names from which query will retrieve data
b. The column names which will affect the sort order of the query result
c. The column names of base tables(s) that are to be included in the result
d. Boolean expressions that are placed with WHERE clause and the expression must evaluate to true for a row to be
included in the result set
4. Which one is used to indicate all columns of the source table should be included in the result of a SELECT query?
a. * b. ? c. % d. ^
5. Which one is NOT a valid alias for ContactFName column?
a. ContactFName ‘First Name’ b. ‘First Name’ = ContactFName
c. ContactFName AS ‘First Name’ d. ContactFName = ‘First Name’
6. Which one returns current date & time? a. DATETIME() b. NOW() c. DATE() d. GETDATE()
7. Any name that does not follow the SQL Server’s rules for naming object must be enclosed in _____.
a. In single quotes b. Curly braces {} c. Brackets [] d. In parentheses ()
8. Which one is the string concatenation operation in SQL Server? a. - b. & c. + d. .
9. Which one is valid string literal? a. ‘SQL Server’ b. [SQL Server] c. “SQL Server” d. SQL Server
10. How can you include a single quote or apostrophe in a string literal?
a. By placing a @ character before the string literal b. By enclosing the quote character within double quotes
c. By placing two single quotes d. By placing a backslash before the quote character
11. In a client/server system, the application software is run on ______.
a. Client b. Server c. Both client and server d. Enterprise server
12. The application software on the client uses data that’s stored on the database using _____. Which one best fits the blank
space? a. a data access API b. network c. a database management system d. SQL queries
13. SQL stands for ____. a. Structured Query Learning b. Structured Query Language
c. Special Query Language d. Standard Query Language
14. Which one is true about SQL? a. A programming language allows to build data-driven applications
b. A language that allows any application communicate with any DBMS
c. A standard language that is understood by any standard application d. All of the above
15. Which one is not true about application servers?
a. Store business components that do part of the processing of the application b. Provide user interface to user
c. Process database requests from the user interface running on the client
d. If the client request involves accessing data in a database, the application server formulates the appropriate query
and passes it on to the database server.
16. In a client/server system, which one provides user interface?
a. The client b. The database server c. DBMS d. The application server
17. What is ADO.Net? a. An application framework from Microsoft to build distributed applications on top of .Net platform
b. A component for building web application
c. Microsoft’s data access API that can communicate directly with the SQL Server
d. An API to access remote systems over internet
18. What does a single row in a table represent?
a. A collection of entries b. An attribute of an entity c. One instance of an entity d. A single value
19. What is a primary key? a. One or more columns that establishes link between tables
b. A column whose value is automatically generated by the system
c. One or more columns that uniquely identify each row in a table
d. A constraint that enforces a value to be present in a column
20. What data type only allows value 1 or 0 that represents a True or False value respectively?
a. Tinyint b. Int c. Boolean d. Bit
=======================================================================================================
1. To connect to a SQL database server, you have to enter __________.
a. the name of the computer, followed by a dash, followed by the name of the SQL Server Database Server
b. the name of the computer, followed by a dot, followed by the name of the SQL Server Database Server
c. the name of the computer, followed by a backslash, followed by the name of the SQL Server Database Server
d. the name of the computer, followed by a front slash, followed by the name of the SQL Server Database Server
2. To connect to the SQL Server Express database engine when it’s running on your PC, you can use the _____ keyword to
specify your computer as the host machine. a. current b. localhost c. host d. local
3. You see a table dbo.Product under a database, what does the dbo.quantifier indicate?
a. The Product table is in Database Server named dbo b. The Product table belongs to the dbo schema
c. The Product table belongs to dbo database
d. The Product table copied from the dbo database to the current database
4. Which one can you use to make it easier to implement the security for a database?
a. Trigger b. User-defined function c. Schema d. Login
5. Which key can you use to execute a query? a. F2 b. F5 c. Ctrl + E d. Ctrl + F5
6. What is the extension of a SQL database data file? a. .df b. .ldf c. .data d. .mdf
7. How many files at least a SQL server database has? a. 1 b. 2 c. 3 d. 4
8. In SQL server, a schema is ___. a. a container that holds objects b. a built-in power user that has rights to create objects
c. a collect of administrative rights d. a container that holds temporary tables
9. Which one is NOT the function of SQL server configuration Manager?
a. Enable/Disable remote connections b. Enable/Disable SQL server reporting service
c. Manually start & stop the database server d. Set order of protocols be used by server & clients
10. What is the purpose client tools installed with SQL server database service?
a. Provide API for client applications to communicate with SQL database service
b. Provide an interface for working with the databases
c. Provides tool manage remote client connection to an SQL server instance d. All of the above
=======================================================================================================
1. Which one correctly defines a join?
a. It merges two tables into one b. It combines result sets of two different queries into a single result set
c. It combines columns from two or more tables into a single result set d. It merges two databases into a single one
2. _____ JOIN returns only those rows that satisfy the join condition. Pick the correct one for the blank space.
a. An INNER JOIN b. An OUTER JOIN c. A CROSS JOIN d. A FULL OUTER JOIN
3. In Which case you must use the qualified name for a column in join query?
a. For all columns b. For the column names that appear in two tables
c. For the columns that participate in join condition d. All of the above
4. _____ are temporary table names assigned in the FROM clause in a SELECT statement.
a. Short names b. Dummy names c. Correlation names d. Virtual names
5. SQL Server lets you join data from upto _____ tables. a. 32 b. 64 c. 128 d. 256
6. ______ retrieves all rows that satisfies the join condition, plus unmatched rows from one or both tables.
a. An INNER JOIN b. An OUTER JOIN c. A CROSS JOIN d. A SELF-JOIN
7. Which type of JOIN returns a Cartesian product of all the records on both sides of the JOIN?
a. An INNER JOIN b. An OUTER JOIN c. A CROSS JOIN d. A SELF-JOIN
8. Which one is an alternative of RIGHT OUTER JOIN? a. *= b. =* c. *=* d. ==
9. See the below query— SELECT v.VendorName, a.Address
FROM Vendors v
CROSS JOIN Address a Which one will return the same result set as the above?
a. SELECT v.VendorName, a.Address FROM Vendors v JOIN Address a
b. SELECT v.VendorName, a.Address FROM Vendors v SELF JOIN Address a
c. SELECT v.VendorName, a.Address FROM Vendors v, Address a
d. SELECT v.VendorName, a.Address FROM Vendors v FULL OUTER JOIN Address a
10. You want to combine the rows from result sets of two select statements into one result. What would you use?
a. CROSS JOIN b. OUTER JOIN c. INNER JOIN d. UNION
=======================================================================================================
1. Which query is correct? a. SELECT Country, COUNT(*) FROM Customers HAVING COUNT(*) > 5 GROUP BY Country
b. SELECT Country, COUNT(*) FROM Customers WHERE COUNT(*) > 5 GROUP BY Country
c. SELECT Country, COUNT(*) FROM Customers GROUP BY Country HAVING COUNT(*) > 5
d. SELECT Country, COUNT(*) FROM Customers GROUP BY Country WHERE COUNT(*) > 5
2. Which is not extension operator of SQL Server for summarizing data? a. OVER b. EXCEPT c. ROLLUP d. CUBE
3. With GROUPING SETS, how can you add summary row that summarizes the entire result set?
a. Within parentheses after the GROUPING SETS operator, add a * symbol
b. Within parentheses after the GROUPING SETS operator, add an empty set of parentheses
c. After the GROUPING SETS operator, add an empty set of parentheses
d. You need not do anything; GROUPING SETS add a summary row by default
4. On which functions ALL or DISTINCT has no effect?
a. COUNT and AVG b. SUM and COUNT c. MIN and MAX d. SUM and AVG
5. Which aggregate function does not always require an expression to operate on? a. MAX b. MIN c. AVG d. COUNT
6. Which one correctly defines a join?
a. It merges two tables into one b. It combines result sets of two different queries into a single result set
c. It combines columns from two or more tables into a single result set d. It merges two databases into a single one
7. ______ are temporary table names assigned in the FROM clause in a SELECT statement.
a. Virtual names b. Dummy names c. Short names d. Correlation names
8. Which one is the correct form of fully-qualified name of database objects?
a. database.object b. schema.object
c. database.schema.object d. server.database.schema.object
9. Boolean expressions or predicates that are used in WHERE clause must result in a value of _____.
a. 0, 1 or Unknown (Null) b. 0 or 1 c. True or False d. True, False or Unknown (Null)
10. Why do you use column alias in a SELECT statement?
a. To name an expression b. To change column heads
c. To rename column of base table d. All of the above
11. ___ performs an operation and returns a value. a. A query b. A view c. A stored procedure d. A function
12. Which keyword do you use in the SELECT clause to eliminate duplicates?
a. UNIQUE b. ALL c. DISTINCT d. REMOVE DUPLICATE
13. How can specify in TOP clause to include additional rows that have the same values as the last row?
a. Include ALL keyword with TOP clause b. Include WITH TIES with TOP clause
c. Include ANY keyword with TOP clause d. Include DISTINCT keyword WITH TOP clause
14. You use ______ to create compound conditions.
a. Functions b. Logical operators c. Arithmetic operators d. Comparison operators
15. The order of evaluation of logical operators is _____.
a. AND, OR, NOT b. NOT, AND, OR c. OR, AND, NOT d. NOT, OR, AND
16. Which operator do you use to retrieve rows that match a string pattern or mask?
a. LIKE b. IS c. == d. =
17. LIKE ‘%ER’ will match ____. a. “Computer1” and “Computer2” b. “Computer” and “Peter, James”
c. “Using Computer” and “Computer World” d. “Computer” and “James Peter”
18. LIKE ‘N[^A-J]’ will match _____. a. NJ b. NC c. NY d. NA

You might also like