The __operator returns all tuples in one relation that are not found in the other relation.
Select
None
intersect
difference
The__ operator combines all tuples from two relations excluding duplicates.
Intersect
union
divide
The HAVING clause does which of the following?
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.
The NULL SQL keyword is used to…
Represent 0 value
Represent a missing or unknown value. NULL in SQL represents nothing.
Represent positive infinity
Represent negative infinity
The SQL BETWEEN operator..
None of the given
Specifies which tables we are selecting from
Specifies that a column is a primary key
Specifies a range to test
The AVG SQL function return the…
Maximum value from a column
Average number of rows in all tables
Average value in a column
The sum of values in a column
The command to remove row from CUSTOMER table is:
REMOVE FROM customer
DROP FROM customer
UPDATE FROM customer
DELETE FROM customer WHERE…
What type of join is needed when you wish to include rows that do not have matching values?
OUTER and INNER JOIN
INNER JOIN
OUTER JOIN
What does the following SQL statement do: SELECT Customer, COUNT(Order) FROM Sales GROUP BY Customer HAVING COUNT (Order)>5
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
What operator tests column for the absence of data ?
NOT operator
IS NULL operator
EXIST operator
What does the SQL FROM clause do?
Specifies a search condition
Specifies the columns we are retrieving
Specifies the table to retrieve rows from
What does follow after the SQL SELECT clause?
List of columns that will selected or the * symbol
Selection condition
The name of the table we are selecting from
What is the keyword you would use before adding conditions to your query?
EQUALS
WHAT
CONDITIONS
WHERE
What is meant by the following relational statement STUDENT X COURSE ?
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
What does follow after the SQL WHERE clause?
List of columns to be selected
Name of the table we are selecting from
What is meant by the term union compatibility?
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
What keyword can you use to search for a string in a column?
FIND STRING
LIKE
CONTAINS STRING
HAS STRING
What is the meaning of LIKE ‘%0%0%’
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
What is the purpose of the SQL AS clause?
The AS clause is used with the aggregate functions only
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
Which product is returned in a join query have no join condition:
Equijoins
Both
Cartesian
Which SQL statement will selects all rows from a table called “Customers” and orders the result by “customer name” ?
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
Which SQL statement is used to extract data from a database?
EXTRACT
OPEN
SELECT
GET
Which of the following is a legal expression in SQL?
SELECT NULL FROM Employee;
SELECT name FROM Employee WHEN salary = NULL;
SELECT name FROM Employee;
Which SQL keyword is used to retrieve a maximum value?
TOP
MOST
UPPER
MAX
Which SQL statement is used to return only different (unique) values?
SELECT *
SELECT DISTINCT
SELECT DIFFERENT
SELECT UNIQUE
Which one of the following sorts rows in SQL?
ORDER BY
GROUP BY
ALIGN BY
SORT BY
Which of the following are the five built-in functions provided by SQL?
SUM,AVG,MULT,DIV,MIN
SUM,AVG,MIN,MAX,MULT
SUM,AVG,MIN,MAX,NAME
COUNT,SUM,AVG,MAX,MIN
Which of the following is the correct order of keywords for SQL SELECT statements?
FROM,WHERE,SELECT
SELECT,WHERE,FROM
WHERE,FROM,SELECT
SELECT,FROM,WHERE
Which SQL keyword is used to sort the result set?
⦁ ORDER BY
⦁ SORT
⦁ FILTER
⦁ SORT BY
Which of the following is NOT a relational algebra operators used in basic queries?
⦁ Select
⦁ Locate
⦁ Project
⦁ Join
Which of the following is not a SQL database manipulation statement?
⦁ SELECT
⦁ CREATE TABLE
⦁ DELETE
⦁ UPDATE
Which of the following SQL statements deletes all rows in table called SalesData?
⦁ DELETE FROM SalesData
⦁ DELETE * FROM SalesData
⦁ DELETE ALL SalesData
⦁ DELETE SalesData
Which of the following is an SQL aggregate function?
⦁ ALTER
⦁ MIN
⦁ BETWEEN
⦁ CREATE
Which of the following is not DML statement?
⦁ INSERT
⦁ ALTER TABLE
With SQL, how do you select all the columns from a table named “Persons”?
⦁ SELECT *.Persons;
⦁ SELECT [all] FROM Persons;
⦁ SELECT * FROM Persons;
⦁ SELECT Persons;
With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName”?
⦁ 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;
With SQL, how can you return the number of records in the “Persons” table?
⦁ SELECT COLUMNS(*) FROM Persons
⦁ SELECT COUNT() FROM Persons
⦁ SELECT COLUMNS() FROM Persons
⦁ SELECT COUNT(*) FROM Persons
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” is “Peter”?
⦁ 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
With SQL, how do you select all the records from a table named “Persons” where the “FirstName” is ”Peter” and the “LastName” is “Jackson”?
⦁ 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’;
How to select all data from student table starting the name from letter ’r’ ?
⦁ 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%’
SQL query and data modification commands make up a(n)___
⦁ DCL
⦁ DDL
⦁ DML
⦁ TCL
DML is used to
⦁ Add and delete tables
⦁ Add/modify/delete data in the database
⦁ Specify the structure of a database
⦁ Manipulate the structure of database applications
If you want to apply second condition to your statement where both statements must be true, what keyword would you use between the conditions?
⦁ AND
⦁ TRUE
⦁ WHERE
⦁ BOTH
Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79
⦁ 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
Like operator uses __ and ___.
⦁ Asterisk(*); percent sign(%)
⦁ Question mark(?); asterisk(*)
⦁ Percent sign(%); underscore(_)
⦁ Underscore(_); question mark(?)
You can add a row using SQL in a database with which of the following?
⦁ ADD
⦁ MAKE
A subquery in an SQL SELECT statement is enclosed in:
⦁ Braces - {…}
⦁ CAPITAL LETTERS
⦁ Parenthesis - (…)
⦁ Brackets – […]
Which of the SQL statements is correct?
SELECT Username, Password WHERE Username = 'user1'
SELECT Username AND Password FROM Users
SELECT Username, Password FROM Users
Which of the following is a DML statement?
DROP TABLE
ALTER TABLE
CREATE TABLE
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"?
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%';
What SQL structure is used to limit column values of a table?
The VALUE constraint
The CHECK constraint
The LIMIT constraint
Which of the following is used to denote the projection operation in relational algebra?
Pi (Greek)
Lambda (Greek)
Omega (Greek)
Sigma (Greek)
To define what columns should be displayed in an SQL SELECT statement:
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.
In the query "SELECT address FROM users", what is the column being selected?
FROM
address
users
Which of the following is used to denote the selection operation in relational algebra?
Which of the following SQL statements will select all records with all their columns from a table called Sales.
DELETE FROM Sales
SELECT * FROM Sales
SELECT * FROM SALES WHERE OrderID < 1
To eliminate duplicate values in a column ______ is used
DISTINCT
NODUPLICATE
None of these
ELIMINATE
Which SQL functions is used to count the number of rows?
COUNTOF()
SUM()
COUNT()
NUMBER()
_____ specifies a search condition for a group or an aggregate function
⦁ FROM Clause
⦁ GROUP BY Clause
⦁ HAVING Clause
⦁ WHERE Clause
What will be the result of the following SQL statement: SELECT * FROM Table1 HAVING Column1 > 10
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
The result of an SQL SELECT statement is a(n) _____
table
form
report
file
What keyword would you use to group your results by a column’s values?
BY
JOIN
With SQL, how do you select a column named “FistName” from a table named “Persons”?
SELECT FirstName FROM Persons;
SELECT Persons.FirstName
EXTRACT FirstName FROM Persons
SQL can be used:
modify database data only
All of the given can be done by SQL
query database data only
create database structure only
Which SQL keyword is used to specify conditional search?
FIND
SEARCH
Which of the following is an SQL aggregate function
AVG
In an SQL SELECT statement querying a single table, the asterisk(*) means that:
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