Question 1
Question
The __operator returns all tuples in one relation that are not found in the other relation.
Answer
-
Select
-
None
-
intersect
-
difference
Question 2
Question
The__ operator combines all tuples from two relations excluding duplicates.
Answer
-
Intersect
-
difference
-
union
-
divide
Question 3
Question
The HAVING clause does which of the following?
Answer
-
Acts like a WHERE clause but HAVING is used for columns rather than groups.
-
Acts like a WHERE clause but HAVING is used for rows rather than columns.
-
Acts like a WHERE clause but HAVING is used for groups rather than rows.
-
Acts EXACTLY like a WHERE clause.
Question 4
Question
The NULL SQL keyword is used to…
Answer
-
Represent 0 value
-
Represent a missing or unknown value. NULL in SQL represents nothing.
-
Represent positive infinity
-
Represent negative infinity
Question 5
Question
The SQL BETWEEN operator..
Answer
-
None of the given
-
Specifies which tables we are selecting from
-
Specifies that a column is a primary key
-
Specifies a range to test
Question 6
Question
The AVG SQL function return the…
Answer
-
Maximum value from a column
-
Average number of rows in all tables
-
Average value in a column
-
The sum of values in a column
Question 7
Question
The command to remove row from CUSTOMER table is:
Question 8
Question
What type of join is needed when you wish to include rows that do not have matching values?
Answer
-
OUTER and INNER JOIN
-
INNER JOIN
-
OUTER JOIN
-
None of the given
Question 9
Question
What does the following SQL statement do: SELECT Customer, COUNT(Order) FROM Sales GROUP BY Customer HAVING COUNT (Order)>5
Answer
-
Selects the total number of orders from the Sales table, if this number is greater than 5
-
Selects all customers with number of orders from table Sales that have made more than 5 orders
-
None of the give
-
Selects all customers from the Sales table
Question 10
Question
What operator tests column for the absence of data ?
Answer
-
NOT operator
-
IS NULL operator
-
EXIST operator
-
None of the given
Question 11
Question
What does the SQL FROM clause do?
Answer
-
Specifies a search condition
-
None of the given
-
Specifies the columns we are retrieving
-
Specifies the table to retrieve rows from
Question 12
Question
What does follow after the SQL SELECT clause?
Question 13
Question
What is the keyword you would use before adding conditions to your query?
Answer
-
EQUALS
-
WHAT
-
CONDITIONS
-
WHERE
Question 14
Question
What is meant by the following relational statement STUDENT X COURSE ?
Answer
-
Compute the full outer join between the STUDENT and COURSE relations
-
Compute the left outer join between the STUDENT and COURSE relations
-
Compute the right outer join between the STUDENT and COURSE relations
-
Compute the cartesian between the STUDENT and COURSE relations
Question 15
Question
What does follow after the SQL WHERE clause?
Question 16
Question
What is meant by the term union compatibility?
Answer
-
None
-
When two or more tables share the same (or compatible) domains
-
When two or more tables share the same number of columns and when they share the same domains
-
When two or more tables share the same number of columns
Question 17
Question
What keyword can you use to search for a string in a column?
Answer
-
FIND STRING
-
LIKE
-
CONTAINS STRING
-
HAS STRING
Question 18
Question
What is the meaning of LIKE ‘%0%0%’
Answer
-
Feature begins with the two 0’s
-
Feature ends with two 0’s
-
Feature has more than two 0’s
-
Feature has two 0’s in it, at any position
Question 19
Question
What is the purpose of the SQL AS clause?
Answer
-
The AS clause is used with the aggregate functions only
-
None of the given
-
The AS clause defines a search condition
-
The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column
Question 20
Question
Which product is returned in a join query have no join condition:
Answer
-
None
-
Equijoins
-
Both
-
Cartesian
Question 21
Question
Which SQL statement will selects all rows from a table called “Customers” and orders the result by “customer name” ?
Answer
-
SELECT * FROM Customers ORDERED customer_name
-
SELECT * FROM Customers ORDERED BY’ customer_name
-
SELECT * FROM Customers ORDER customer_name
-
SELECT * FROM Customers ORDER ON customer_name
Question 22
Question
Which SQL statement is used to extract data from a database?
Question 23
Question
Which of the following is a legal expression in SQL?
Answer
-
SELECT NULL FROM Employee;
-
SELECT name FROM Employee WHEN salary = NULL;
-
None of the given
-
SELECT name FROM Employee;
Question 24
Question
Which SQL keyword is used to retrieve a maximum value?
Question 25
Question
Which SQL statement is used to return only different (unique) values?
Answer
-
SELECT *
-
SELECT DISTINCT
-
SELECT DIFFERENT
-
SELECT UNIQUE
Question 26
Question
Which one of the following sorts rows in SQL?
Answer
-
ORDER BY
-
GROUP BY
-
ALIGN BY
-
SORT BY
Question 27
Question
Which of the following are the five built-in functions provided by SQL?
Answer
-
SUM,AVG,MULT,DIV,MIN
-
SUM,AVG,MIN,MAX,MULT
-
SUM,AVG,MIN,MAX,NAME
-
COUNT,SUM,AVG,MAX,MIN
Question 28
Question
Which of the following is the correct order of keywords for SQL SELECT statements?
Answer
-
FROM,WHERE,SELECT
-
SELECT,WHERE,FROM
-
WHERE,FROM,SELECT
-
SELECT,FROM,WHERE
Question 29
Question
Which SQL keyword is used to sort the result set?
Answer
-
⦁ ORDER BY
-
⦁ SORT
-
⦁ FILTER
-
⦁ SORT BY
Question 30
Question
Which of the following is NOT a relational algebra operators used in basic queries?
Answer
-
⦁ Select
-
⦁ Locate
-
⦁ Project
-
⦁ Join
Question 31
Question
Which of the following is not a SQL database manipulation statement?
Answer
-
⦁ SELECT
-
⦁ CREATE TABLE
-
⦁ DELETE
-
⦁ UPDATE
Question 32
Question
Which of the following SQL statements deletes all rows in table called SalesData?
Question 33
Question
Which of the following is an SQL aggregate function?
Answer
-
⦁ ALTER
-
⦁ MIN
-
⦁ BETWEEN
-
⦁ CREATE
Question 34
Question
Which of the following is not DML statement?
Answer
-
⦁ UPDATE
-
⦁ INSERT
-
⦁ ALTER TABLE
-
⦁ DELETE
Question 35
Question
With SQL, how do you select all the columns from a table named “Persons”?
Question 36
Question
With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName”?
Answer
-
⦁ SELECT * FROM Persons SORT BY ‘FirstName’ DESC;
-
⦁ SELECT * FROM Persons ORDER BY FirstName DESC;
-
⦁ SELECT * FROM Persons SORT ‘FirstName’ DESC;
-
⦁ SELECT * FROM Persons ORDER FirstName DESC;
Question 37
Question
With SQL, how can you return the number of records in the “Persons” table?
Answer
-
⦁ SELECT COLUMNS(*) FROM Persons
-
⦁ SELECT COUNT() FROM Persons
-
⦁ SELECT COLUMNS() FROM Persons
-
⦁ SELECT COUNT(*) FROM Persons
Question 38
Question
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” is “Peter”?
Answer
-
⦁ SELECT * FROM Persons WHERE FirstName = ‘Peter’
-
⦁ SELECT [all] FROM Persons WHERE FirstName = ‘Peter’
-
⦁ SELECT [all] FROM Persons WHERE FirstName LIKE ‘Peter’
-
⦁ SELECT * FROM Persons WHERE FirstName <> ‘Peter
Question 39
Question
With SQL, how do you select all the records from a table named “Persons” where the “FirstName” is ”Peter” and the “LastName” is “Jackson”?
Answer
-
⦁ SELECT * FROM Persons WHERE LastName = ‘Jackson’;
-
⦁ SELECT FirstName = ’Peter’, LastName = ‘Jackson’ FROM Persons;
-
⦁ SELECT * FROM Persons WHERE FirstName <> ‘Peter’ AND LastName<>’Jackson’;
-
⦁ SELECT * FROM Persons WHERE FirstName = ‘Peter’ AND LastName =’Jackson’;
Question 40
Question
How to select all data from student table starting the name from letter ’r’ ?
Answer
-
⦁ SELECT * FROM student WHERE name LIKE ‘%’
-
⦁ SELECT * FROM student WHERE name LIKE ‘%r’
-
⦁ SELECT * FROM student WHERE name LIKE ‘r%’
-
⦁ SELECT * FROM student WHERE name LIKE ‘%r%’
Question 41
Question
SQL query and data modification commands make up a(n)___
Question 42
Answer
-
⦁ Add and delete tables
-
⦁ Add/modify/delete data in the database
-
⦁ Specify the structure of a database
-
⦁ Manipulate the structure of database applications
Question 43
Question
If you want to apply second condition to your statement where both statements must be true, what keyword would you use between the conditions?
Answer
-
⦁ AND
-
⦁ TRUE
-
⦁ WHERE
-
⦁ BOTH
Question 44
Question
Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79
Answer
-
⦁ SELECT *FROM weather WHERE humidity NOT BETWEEN 63 AND 79
-
⦁ SELECT *FROM weather WHERE humidity BETWEEN 63 AND 79
-
⦁ SELECT *FROM weather WHERE humidity = 63 to 79
-
⦁ SELECT *FROM weather WHERE humidity 63 AND 79
Question 45
Question
Like operator uses __ and ___.
Answer
-
⦁ Asterisk(*); percent sign(%)
-
⦁ Question mark(?); asterisk(*)
-
⦁ Percent sign(%); underscore(_)
-
⦁ Underscore(_); question mark(?)
Question 46
Question
You can add a row using SQL in a database with which of the following?
Answer
-
⦁ ADD
-
⦁ MAKE
-
⦁ INSERT
-
⦁ CREATE
Question 47
Question
A subquery in an SQL SELECT statement is enclosed in:
Answer
-
⦁ Braces - {…}
-
⦁ CAPITAL LETTERS
-
⦁ Parenthesis - (…)
-
⦁ Brackets – […]
Question 48
Question
Which of the SQL statements is correct?
Answer
-
SELECT Username, Password WHERE Username = 'user1'
-
SELECT Username AND Password FROM Users
-
None of the given
-
SELECT Username, Password FROM Users
Question 49
Question
Which of the following is a DML statement?
Answer
-
DROP TABLE
-
ALTER TABLE
-
CREATE TABLE
-
SELECT
Question 50
Question
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
Answer
-
SELECT * FROM Persons WHERE FirstName='a';
-
SELECT * FROM Persons WHERE FirstName LIKE '%a';
-
SELECT * FROM Persons WHERE FirstName='%a%';
-
SELECT * FROM Persons WHERE FirstName LIKE 'a%';
Question 51
Question
What SQL structure is used to limit column values of a table?
Answer
-
None of the given
-
The VALUE constraint
-
The CHECK constraint
-
The LIMIT constraint
Question 52
Question
Which of the following is used to denote the projection operation in relational algebra?
Answer
-
Pi (Greek)
-
Lambda (Greek)
-
Omega (Greek)
-
Sigma (Greek)
Question 53
Question
To define what columns should be displayed in an SQL SELECT statement:
Answer
-
use USING to name the source table(s) and list the columns to be shown after WHERE.
-
use USING to name the source table(s) and list the columns to be shown after SELECT.
-
use FROM to name the source table(s) and list the columns to be shown after SELECT.
-
use SELECT to name the source table(s) and list the columns to be shown after USING.
Question 54
Question
In the query "SELECT address FROM users", what is the column being selected?
Answer
-
FROM
-
SELECT
-
address
-
users
Question 55
Question
Which of the following is used to denote the selection operation in relational algebra?
Answer
-
Sigma (Greek)
-
Pi (Greek)
-
Lambda (Greek)
-
Omega (Greek)
Question 56
Question
Which of the following SQL statements will select all records with all their columns from a table called Sales.
Question 57
Question
To eliminate duplicate values in a column ______ is used
Answer
-
DISTINCT
-
NODUPLICATE
-
None of these
-
ELIMINATE
Question 58
Question
Which SQL functions is used to count the number of rows?
Answer
-
COUNTOF()
-
SUM()
-
COUNT()
-
NUMBER()
Question 59
Question
_____ specifies a search condition for a group or an aggregate function
Answer
-
⦁ FROM Clause
-
⦁ GROUP BY Clause
-
⦁ HAVING Clause
-
⦁ WHERE Clause
Question 60
Question
What will be the result of the following SQL statement: SELECT * FROM Table1 HAVING Column1 > 10
Answer
-
a. None of the given
-
b. The SQL statement will generate an error
-
c. The result will be empty data set
-
d. The result will be all rows from Table1 which have Column1 values greater than 10
Question 61
Question
The result of an SQL SELECT statement is a(n) _____
Question 62
Question
What keyword would you use to group your results by a column’s values?
Answer
-
ORDER BY
-
BY
-
JOIN
-
GROUP BY
Question 63
Question
With SQL, how do you select a column named “FistName” from a table named “Persons”?
Question 64
Question
SQL can be used:
Answer
-
modify database data only
-
All of the given can be done by SQL
-
query database data only
-
create database structure only
Question 65
Question
Which SQL keyword is used to specify conditional search?
Question 66
Question
Which of the following is an SQL aggregate function
Question 67
Question
In an SQL SELECT statement querying a single table, the asterisk(*) means that:
Answer
-
None of the given
-
all records meeting the full criteria are to be returned
-
all columns of the table are to be returned.
-
all records with even partial criteria met are to be returned