Question 1
Question
What command do you use to perform a query in SQL?
Question 2
Question
What wildcard character retrieves all records with the SELECT command?
Question 3
Question
What would you use to combine two parameters in a query in SQL
Question 4
Question
What clause would you use with the SELECT command that would pull records based on a range?
Question 5
Question
What keyword used with the SELECT statement is used to not output specified records?
Answer
-
OR
-
DISALLOW
-
DISREGARD
-
NOT
Question 6
Question
What would you use to combine columns from two different tables?
Question 7
Question
Which clause used with the SELECT command will return values that you want to exclude from the normal parameters?
Answer
-
EXCEPT
-
INTERSECT
-
SEARCH
-
EXCLUDE
Question 8
Question
What clause is used to combine related data from multiple table sources?
Question 9
Question
What statement would you use to add data to a table?
Question 10
Question
What statement would you use to change data in a table?
Answer
-
CHANGE
-
MODIFY
-
INSERT
-
UPDATE
Question 11
Question
What statement is used to delete one or more rows in a table?
Answer
-
DELETE
-
REMOVE
-
TRUNCATE
-
CHANGE
Question 12
Question
What statement is used to delete a table from a database?
Answer
-
DELETE
-
DROP
-
REMOVE
-
TRUNCATE
Question 13
Question
How can you prevent the accidental loss of an entire table?
Answer
-
Use the DELETE TRANS command
-
Use the LOOPBACK command.
-
Use the SAFEDELETE command.
-
Use referential integrity.
Question 14
Question
What do you perform when you want to recall specific records from a database?
Answer
-
recall
-
virtual extraction
-
reach
-
query
Question 15
Question
What command would you use to delete a table while leaving the table structure in place for future use?
Answer
-
DELETE TABLE
-
TRUNCATE TABLE
-
REMOVE TABLE
-
STOP TABLE
Question 16
Question
What statement would you use to pull all records in which the State is CA from the Users table?
[blank_start]SELECT *[blank_end]
[blank_start]FROM Users[blank_end]
[blank_start]WHERE State = 'CA'[blank_end]
Answer
-
SELECT *
-
FROM Users
-
WHERE State = 'CA'
Question 17
Question
What statement would you use to pull First_Name and Last_Name from the Users table in which Gender is F and State is CA?
[blank_start]SELECT First_Name, Last_Name[blank_end]
[blank_start]FROM Users[blank_end]
[blank_start]WHERE Gender = 'F' AND State = 'CA'[blank_end]
Question 18
Question
What statement would you use to list the First_Name and Last_Name from the Users table which Department is not IT?
[blank_start]SELECT First_Name, Last_Name[blank_end]
[blank_start]FROM Users[blank_end]
[blank_start]WHERE NOT Department = 'IT'[blank_end]
Question 19
Question
What statement would you use to delete the Equipment table?
[blank_start]DROP TABLE Equipment[blank_end]
Question 20
Question
The terms "bitmap," "b-tree," and "hash" refer to which type of database structure?
Answer
-
View
-
Function
-
Index
-
Stored procedure
-
Trigger
Question 21
Question
One reason to add an index is to:
Answer
-
Decrease storage space.
-
Increase database security.
-
Improve performance of select statements.
-
Improve performance of insert statements.
Question 22
Question
You have the first table that contains the following data.
You break the table into the following two tables.
This process is referred to as:
Answer
-
defragmentation
-
normalization
-
fragmentation
-
denormalization
Question 23
Question
You have a table that contains the following data.
Which database term is used to describe the relationship between ProductID and
ProductCategory?
Answer
-
Cohort
-
Relationally dependent
-
Deterministic
-
Functionally dependent
-
Compositional
Question 24
Question
Which key uniquely identifies a row in a table?
Answer
-
foreiqn
-
primary
-
local
-
superkey
Question 25
Question
Which statement creates a composite key?
Question 26
Question
What statement would you use to pull First_Name, Last_Name, and ID_Number from the Users table?
[blank_start]SELECT First_Name, Last_Name, ID_Number[blank_end]
[blank_start]FROM Users[blank_end]
Question 27
Question
At 3:00 P.M. (1500 hours), you create a backup of your database. At 4:00 P.M. (1600
hours), you create a table named Customer and import data into the table. At 5:00 P.M.
(1700 hours), your server fails.
You run a script to apply only the 3:00 P.M. backup to your database. What is the result of
the script?
Answer
-
The Customer table no longer exists.
-
The Customer table is unaffected
-
The Customer table exists but has no data.
-
The script fails.
Question 28
Question
In which situation do you need to perform a restore on a database?
Answer
-
when data becomes corrupted in the database
-
when you need to roll back a transaction
-
when you encounter an error in your application
-
when data needs to be deleted from the database
Question 29
Question
Which command should you use to give a user permission to read the data in a table?
Answer
-
ALLOW SELECT
-
LET READ
-
PERMIT READ
-
GRANT SELECT
Question 30
Question
You need to enable a new employee to authenticate to your database.
Which command should you use?
Answer
-
ALLOW USER
-
CREATE USER
-
ADD USER
-
INSERT USER
-
ALTER USER
Question 31
Question
Which keyword can be used in a create table statement?
Answer
-
ORDER BY
-
DISTINCT
-
GROUP BY
-
UNIQUE
Question 32
Question
You need to store product quantities, and you want to minimize the amount of storage
space that is used. Which data type should you use?
Answer
-
INTEGER
-
DOUBLE
-
COUNT
-
FLOAT
Question 33
Question
Which statement will result in the creation of an index?
Question 34
Question
You have the following table definition:
CREATE TABLE Road
(RoadID INTEGER NOT NULL,
Distance INTEGER NOT NULL)
You execute the following statement:
INSERT INTO Road VALUES (1234, 36)
What is the result?
Question 35
Question
You need to store product names that vary from three to 30 characters. You also need to
minimize the amount of storage space that is used.
Which data type should you use?
Answer
-
VARCHAR (3, 30)
-
CHAR (3, 30)
-
VARCHAR (30)
-
CHAR (30)
Question 36
Question
One reason to create a stored procedure is to:
Question 37
Question
Which permission does a user need in order to run a stored procedure?
Question 38
Question
You have a table named Product. You create a view that includes all the products from the
Product table that are in the Furniture category.
You execute a statement on the Product table that deletes all the products in the Furniture
category.
After you execute the statement, the result set of the view is:
Answer
-
Empty
-
Deleted
-
Unchanged
-
Archived
Question 39
Question
In SQL, an insert statement is used to add a:
Question 40
Question
Which of the following is NOT stored in the sysobjects system table?
Answer
-
Functions
-
Triggers
-
Constraints
-
Indexes
Question 41
Question
[blank_start]ADD[blank_end] is a reserved keyword in SQL SERVER 2008 and therefore cannot be used as an object name or as a column name in a table, unless delimited.
Answer
-
ADD
-
none of the above
-
SUBTRACT
-
MINUS
Question 42
Question
Which of the following range conditions would generate a syntax error?
Answer
-
salary <= 50000 AND salary >= 10000
-
salary between (10000 AND 50000) AND (60000 and 90000)
-
salary >=10000 AND salary <= 50000
-
salary BETWEEN 10000 AND 50000
Question 43
Question
Which statement is false?
Answer
-
A table provides structure to store data.
-
A table can be created in a graphical interface and using syntax.
-
A database cannot parse out redundant data.
-
A database retrieves data from different tables and views.
Question 44
Question
What is collation?
Answer
-
It is data design and organizations process applied to data structures, based on rules that help building relational databases.
-
It is a concept in SQL Server by which we can add other SQL Server to a group and query both the SQL Servers dbs using T-SQL statements.
-
It means that the data in the db is organized so that all the data elements relating to the same real-world event or object are linked together.
-
It refers to a set of rules that determine how data is sorted and compared
Question 45
Question
Which of the following conditions will you use in a WHERE clause to select all last names that start with J?
Answer
-
WHERE LastName = 'J*'
-
WHERE LastName LIKE 'J%'
-
WHERE LastName = 'J%'
-
WHERE LastName LIKE 'J'
Question 46
Question
What is the best data type to store the birthdays of the greatest scientists, starting with Leonardo Da Vinci's birthday of April 15, 1452?
Answer
-
INT
-
VARCHAR
-
DATETIME
-
SMALLDATETIME
Question 47
Question
If you need to calculate a percentage value, what data type is the best option?
Answer
-
Float
-
Integer
-
SmallInt
-
BigInt
Question 48
Question
You have a column that will only contain from 0 to 1024. What is the most economical data type to use for the column?
Answer
-
SMALLINT
-
DECIMAL(3)
-
TINYINT
-
INT
Question 49
Question
What is the statement used to suppress the '(1 row(s) affected.' after executing query statements?
Answer
-
SET NO COUNTING
-
SET NO COUNT
-
SET NO COUNTING ON
-
SET NOCOUNT ON
Question 50
Question
Which of the following is not supported by the ALTER TABLE command?
Answer
-
Modifying the data type of an existing column.
-
Adding a new column to a table.
-
Changing the IDENTITY constraint of an existing column
-
Deleting multiple columns from an existing table.
Question 51
Question
If the data is May 1st 2011 at 09:23AM. What will be the result of the following SELECT statement?
SELECT GETDATE() + 3
Question 52
Question
What will be the output of the following statement?
SELECT CHARINDEX('GM',"The best TTS solutions are provided by GMetrix', -1)
Question 53
Question
What will be the result of the following statement?
SELECT CAST (-1 AS SMALLDATETIME)
Question 54
Question
What will be the result of the following statement?
SELECT REPLACE ('The best TTS solutions is provided by GMetrix', 's', 'z')
Answer
-
None of the above
-
The beszt TTSz szolutionsz isz provided by GMetrix
-
A SQL Server Orthographic error
-
The bezt TTz zolutionz iz provided by GMetrix
Question 55
Question
What command would you use to display all records from the clients table that have the state of New Mexico and the city of Roswell?
Answer
-
SELECT * FROM clients WHERE state = "New Mexico" AND City = "Roswell"
-
SELECT * FROM clients WHERE state = New Mexico AND City = Roswell
-
SELECT * FROM clients WHERE state = 'New Mexico' OR City = 'Roswell'
-
SELECT * FROM clients WHERE state = 'New Mexico' AND City = 'Roswell'
Question 56
Question
What will be the results of the following statement?
CREATE VIEW cambridge_data AS SELECT NoControl, FullName FROM cambridge ORDER BY FullName
Answer
-
A SQL Sever Database Error because the clause ORDER BY is not valid in the creation of a view.
-
A SQL Sever Database Error because the CREATE VIEW statement is not within a BEGIN/END block.
-
A SQL Sever Database Error because the same column cannot be used multiple times in the statement.
-
The creation of a view called cambridge_date with the data ordered by the field FullName.
Question 57
Question
What is the right way to get an accurate count of the number of records in a table?
Question 58
Question
What is a subquery?
Answer
-
A query that displays only the rows that match in two joined tables.
-
A particular case when one table joins itself with one or more aliases to avoid confusion.
-
A join that displays only the rows even if they do not have related rows in the joined table.
-
A select statement that is nested within another T-SQL statement.
Question 59
Question
SELECT STR(938.56, 6, 1)
Answer
-
938.56
-
938.5
-
0938.5
-
938.6
Question 60
Question
What are the entities that can be viewed in the SQL Server Utility?
Answer
-
Instances of SQL Server, Data-Tier apps, Database Files, Volumes
-
Disks, Volumes, Users
-
Instances of SQL Server, Users, Store Procedures, Volumes
-
Instances of SQL Server, Store Procedures, Tables
Question 61
Question
Which of the following could not be used as a primary key?
Question 62
Question
Which of the following can be used to improve query performance?
Answer
-
All of the above
-
UNIQUE index
-
PRIMARY KEY
-
CLUSTERED index
Question 63
Question
Which of the following statements is not true about a FOREIGN KEY?
Answer
-
A table can contain only one FOREIGN key.
-
You can create a foreign key by defining a FOREIGN KEY constraint when you create or alter a table.
-
A FOREIGN KEY enforces referential integrity by ensuring only valid data is stored.
-
A foreign key is a combination of one or more columns used to establish and enforce a link between the data in two tables.
Question 64
Question
Which of the following is NOT true about the PRIMARY KEY constraint?
Answer
-
It is always created as CLUSTERED.
-
It is a column that participates in the PRIMARY KEY constraint cannot accept NULL values.
-
It can be composed of more than 1 column.
-
It enforces data uniqueness by creating a unique index for the primary key columns.
Question 65
Question
What is the DBCC command used for checking that tables in the db and the indexes are correctly linked?
Answer
-
CHECKLINK
-
CHECKDB
-
CHECKFILEGROUP
-
CHECKALLOC
Question 66
Question
Which of the following is NOT a fixed server role?
Answer
-
Accessadmin
-
Diskadmin
-
Setupadmin
-
Securityadmin
Question 67
Question
The Cambridge db is acesses by several users in LA, regularly during business hours. You need to ensure that personnel cannot login on to db outside of normal business hours, which is defined as 8:00am to 5:00m, Monday through Saturday, what should you do?
Answer
-
Create a logon trigger to prevent logons after normal business hours.
-
Write a store procedure to respond to all logon events and prevent logons after hours.
-
Create a SQL Server Agent job to shut down the server after 6:00pm and restart before 7:00am.
-
Broadcast a notification indicating the business hours.
Question 68
Question
The Cambridge db is using full recovery model. You perform full backups once a week on Friday nights and differential backups every day. If the Cambridge db fails on Friday morning, what should you do first?
Answer
-
Restore the full backup
-
Restore the transaction log
-
Backup the transaction log
-
Restore the most recent differential backup
Question 69
Question
[blank_start]Backup[blank_end] is the best method to prevent the loss of data.
Answer
-
Backup
-
Redundant NIC's
-
UPS
-
RAID
Question 70
Question
We have the following table:
Name varchar(50)
Lastname varchar(50)
Email varchar(50)
Phone varchar(15)
If we need to store 100,000 records, the estimate size of the table will be:
Answer
-
157.3563 MB
-
1.573563 GB
-
15.73563 MB
-
1.573563 MB
Question 71
Question
How many files does Microsoft SQL Server use to store the database?
Question 72
Question
What is the sub-language that allows user to insert, delete, and update data in a database?
Question 73
Question
Which of these sentences is incorrect?
Answer
-
SELECT * FROM cambridge WHERE id IN (1,3,5)
-
SELECT * FROM cambridge WHERE id NOT IN (1,5)
-
SELECT * FROM cambridge WHEREid BETWEEN (1,5)
-
SELECT * FROM cambridge WHERE id <> (15)
Question 74
Question
The DROP command allows you to [blank_start]permanently delete a database/table.[blank_end]
Answer
-
permanently delete a database/table.
-
create new objects like a database/table
-
delete a record from a table.
-
modify the definition of an object.
Question 75
Question
Which three are T-SQL commands to handle privileges? (Choose three.)
Answer
-
REFUSE
-
DENY
-
PERMIT
-
GRANT
-
RECIND
-
REVOKE
Question 76
Question
[blank_start]DROP LOGIN[blank_end] removes a SQL Server login account.
Answer
-
DROP LOGIN
-
DELETE LOGIN
-
DELETE USER
-
DROP USER
Question 77
Question
What does SQL stand for?
Question 78
Question
What are three types of databases?
Answer
-
Context Model, Associative Model, Entity-Attribute-Value (EAV) data model
-
Oracle, DB2, SQL Server
-
Network Model, Relational Model, Object Oriented Model
-
Relational, Flat File, Hierarchical
Question 79
Question
What is the maximum date value that can be stored in a SMALLDATETIME data type?
Answer
-
June 6, 2079
-
December 31, 9999
-
July 6, 2079
-
December 31, 2079
Question 80
Answer
-
A virtual table created by a query joining one or more tables
-
A command to recover the content of a table.
-
A physical copy of a table
-
The result of the execution of a query
Question 81
Question
Which option is not a T-SQL command to handle privileges?
Question 82
Question
What is a trigger?
Answer
-
A named group of SQL statements that have been previously created and stored in the server database.
-
A physical structure containing pointers to the data.
-
A subset of a table.
-
A SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs.
Question 83
Question
The WHERE clause allows you to [blank_start]obtain a subset of rows.[blank_end]
Question 84
Question
Consider a query of two tables. The results contains only the rows that have a match in both tables. What kind of JOIN was used?
Answer
-
RIGHT OUTER JOIN
-
INNER JOIN
-
LEFT OUTER JOIN
-
FULL OUTER JOIN
Question 85
Question
What statement is used to retrieve data from a database?
Question 86
Question
The result of the query:
SELECT COUNT (*) from employees
will be:
Answer
-
All of the above.
-
All the records that contains the character *.
-
All the records of the table employees.
-
The number of rows in the table employees.
Question 87
Question
What is the result of the following query:
SELECT MAX (salary) from employee
Answer
-
The average salary of all employees.
-
The salary of the employee with the highest value in the identifier column.
-
The maximum salary of all employees.
-
The salary of the employee called Max.
Question 88
Question
What statement is used to remove a record from a table?
Answer
-
REMOVE
-
TRUNCATE
-
DELETE
-
ERASE
Question 89
Question
What does the following statment do?
SELECT DATEADD(DD, 0, DATEDIFF(DD, 0, GETDATE()))
Answer
-
The statement will generate an error. The second parameter of the DATEDIFF function should be a DATETIME data type.
-
Return the current system date unchanged.
-
Return the integer value of the current system date.
-
Return just the date part of the current system date removing the time.
Question 90
Question
How many levels of normal forms are there?
Question 91
Question
What determines a database in the third normal form?
Answer
-
The table faithfully represents a relation and has not repeating groups.
-
Every non-prime attribute ins non-transitively dependent on every candidate key in the table.
-
Every non-trivial join dependency in the table is implied by the superkeys of the table.
-
No non-prime attribute in the table is functionally dependent on a proper subset of a candidate key.
Question 92
Question
A unique constraint allows you to specify _________________.
Answer
-
each record in a database table.
-
the types of data a user can insert into the database.
-
that data is entered into a cell.
-
which column should not contain duplicate values.
Question 93
Question
An index allows you to ______________________.
Answer
-
increase the performance of a query.
-
order the columns in a table.
-
write better queries.
-
define the maximum size of a table.
Question 94
Question
SQL code injection is _________________________.
Answer
-
an insert statement.
-
a technique that exploits security vulnerabilities in the db layer of an application.
-
the execution of a store procedure.
-
the use of SQL statements in high level languages.
Question 95
Question
[blank_start]Dbcreator[blank_end] can create, alter, and resize databases.
Answer
-
Dbcreator
-
Diskadmin
-
Bulkadmin
-
Setupadmin
Question 96
Question
Members of what fixed database role cannot add, modify or delete any data in the tables within a database, regardless of other roles?
Answer
-
db_datareader
-
db_denydatawriter
-
db_backupoperator
-
db_ddladmin
Question 97
Question
Which of the following fixed server roles can shut down the SQL Server?
Answer
-
serveradmin
-
processadmin
-
securityadmin
-
setupadmin
Question 98
Question
What are the three different methods for which a user can be identified in Server Level security?
Answer
-
None of the above.
-
Windows user login, SQL Server login, Use of Credentials
-
Root, SA, SQL Server login
-
Windows user login, membership in a windows group, SQL Server login
Question 99
Question
[blank_start]Full backup[blank_end] preserves data by creating multiple copies that are based on the differences in the data. A successive copy of the data contains only that portion which has changed sine the preceding copy has been created.
Answer
-
Full backup
-
Differential backup
-
Daily backup
-
Incremental backup
Question 100
Question
Which of the following, is the filename extension of Microsoft SQL Server transaction log?
Question 101
Question
What type of data structure improves data recovery speed?
Answer
-
tri
-
filter
-
Index
-
Transaction Log
Question 102
Question
Which of the following is a collection of programs that enable you to capture, organize, and select data from a database?
Answer
-
disk program
-
group spreadsheets
-
application DAT
-
DBMS
Question 103
Question
Which of the following defines a simple database using two-dimensional tables consisting of rows and columns?
Answer
-
flat-type database
-
hierarchical database
-
Relational Database
-
table as a database
Question 104
Question
Which of the following refers to a database with multiple tables with parent / child relationships and a child can have more than one parent?
Answer
-
flat file database
-
hierarchical database
-
Relational Database
-
table as database
Question 105
Question
Which allows multiple users to access both a SQL database?
Question 106
Question
Among the following, which sets limits or rules placed on a file or a column to ensure that the data is considered valid for a database?
Answer
-
checker
-
validator
-
scanner
-
constraint
Question 107
Question
Among the following, which is the main tool used to configure the databases to Microsoft SQL Server?
Answer
-
DBS
-
SSMS
-
SQL Configuration Tool
-
ODBC SQL emulator
Question 108
Question
Which of the following is the language element allowing you to use statements, such as INSERT, UPDATE and DELETE to manipulate the data in any SQL Server table?
Question 109
Question
Which of the following statements is a T-SQL subset responsible for creating database objects such as tables and stored procedures?
Question 110
Question
Which statement type uses USE, CREATE, ALTER, and DROP?
Question 111
Question
Which of the following refers to the statement allowing you to delete the table in a SQL database?
Question 112
Question
Which of the following refers to the statement that you can use to remove rows from a table?
Answer
-
SELECT
-
UPDATE
-
DELETE
-
STOP
Question 113
Question
Which of the following statements is the primary method to program and manage SQL Server?
Answer
-
DOS Commands
-
SQLCMD Scripts
-
XQuery
-
T-SQL
Question 114
Question
Which of the following allows you to execute SQL commands in an application from the command line?
Answer
-
DOS Commands
-
SQLCMD Scripts
-
XQuery
-
Transact-SQK
Question 115
Question
[blank_start]Database[blank_end] is an organized collection of data, usually stored electronically.
Question 116
Question
The main data files used on a Microsoft SQL server have an extension [blank_start].mdf[blank_end]
Question 117
Question
Which statement is used to add or remove columns in a table?
[blank_start]ALTER[blank_end]
Question 118
Question
What command can you use to change the context of the database?
[blank_start]USE[blank_end]