SQL Multiple Choice Question set-1

SQL stand for Structured query language and this is the basic of almost all the database driven software. How much you are efficient in SQL will also define you much time and money you can save the development cost of your software.

Q 1. What is the full form of SQL?

A) Structured Query Language
B) Structured Query List
C) Simple Query Language
D) None of these

Show Answer

Answer: Option A
Solution:
SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS).
Originally based upon relational algebra and tuple relational calculus, SQL consists of a data definition language and a data manipulation language. The scope of SQL includes data insert, query, update and delete, schema creation and modification, and data access control.

Q 2. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?

A) Data Definition Language(DDL)
B) Data Manipulation Language(DML)
C) Both of above
D) None

Show Answer

Answer: Option A
Solution:
The Data Definition Language (DDL) is used to manage table and index structure.
CREATE, ALTER, RENAME, DROP and TRUNCATE statements are the names of few data definition elements.

Q 3. Which operator performs pattern matching?

A) BETWEEN operator
B) LIKE operator
C) EXISTS operator
D) None of these

Show Answer

Answer: Option B
Solution:
LIKE is a keyword that is used in the WHERE clause. Basically, LIKE allows us to do a search based operation on a pattern rather than specifying exactly what is desired (as in IN) or spell out a range (as in BETWEEN).

The syntax is as follows:
SELECT “column_name”
FROM “table_name”
WHERE “column_name” LIKE {PATTERN}

{PATTERN} often consists of wildcards. In SQL, there are two wildcards:

1=% (percent sign) represents zero, one, or more characters.
2=_ (underscore) represents exactly one character.

Q 4. What operator tests column for the absence of data?

A) EXISTS operator
B) NOT operator
C) IS NULL operator
D) None of these

Show Answer

Answer: Option C
Solution:
Always use IS NULL to look for NULL values.

Syntax:

SELECT “column_name”
FROM “table_name”
WHERE “column_name” IS NULL

Q 5. In SQL, which command(s) is(are) used to change a table’s storage characteristics?

A) ALTER TABLE
B) MODIFY TABLE
C) CHANGE TABLE
D) All of the above

Show Answer

Answer: Option A
Solution:
To change the structure of the table we use ALTER TABLE.
Sytax:
ALTER TABLE “table_name”
ADD “column_name” datatype

OR

ALTER TABLE “table_name”
DROP COLUMN “column_name”
etc..

Q 6. In SQL, which of the following is not a data definition language commands?

A) RENAME
B) REVOKE
C) GRANT
D) UPDATE

Show Answer

Answer: Option D
Solution:
RENAME: – With RENAME statement you can rename a table.
REVOKE: – The REVOKE command removes user access rights or privileges to the database objects.
GRANT: – In SQL GRANT is a command used to provide access or privileges on the database objects to the users.
UPDATE: – The UPDATE Statement is used to modify the existing rows in a table.

RENAME, REVOKE and GRANT are DDL(Data Definition Language) commands and UPDATE is DML(Data Manipulation Language) command.

Q 7. In SQL, which command is used to SELECT only one copy of each set of duplicable rows

A) SELECT DISTINCT
B) SELECT UNIQUE
C) SELECT DIFFERENT
D) All of the above

Show Answer

Answer: Option A
Solution:
The SELECT keyword allows us to grab all information from a column (or columns) on a table. This, of course, necessarily means that there will be redundancies. What if we only want to select each distinct element? This is easy way to accomplish in SQL. All we need to do is that to add DISTINCT after SELECT. The syntax is as follows:

SELECT DISTINCT column_name
FROM table_name;

Q 8. A command that lets you change one or more fields in a record is

A) Insert
B) Modify
C) Look-up
D) All of the above

Show Answer

Answer: Option B
Solution:
Sometimes we need to change the data type of a column. To do this, we use the ALTER TABLE Modify Column command.
Sytax:
ALTER TABLE table_name
MODIFY column_name “New Data Type”

Q 9. Which of the SQL statements is correct?

A) SELECT Username AND Password FROM Users
B) SELECT Username, Password FROM Users
C) SELECT Username, Password WHERE Username = ‘user1’
D) None of these

Show Answer

Answer: Option B
Solution:
Correct order of SELECT, FROM and WHERE clause is as follow:
SELECT column_name1, column_name2, ….
FROM table_name
WHERE condition

So, only
SELECT Username, Password FROM Users
follows the above syntax.

Q 10. The FROM SQL clause is used to…

A) specify what table we are selecting or deleting data FROM
B) specify range for search condition
C) specify search condition
D) None of these

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 11. Which SQL keyword is used to retrieve only unique values?

A) DISTINCTIVE
B) UNIQUE
C) DISTINCT
D) DIFFERENT

Show Answer

Answer: Option C
Solution:
This command is used to select the distinct rows.
For Example: If we want to select all distinct department names from employee table, the query would be:
SELECT DISTINCT dept FROM employee;

Q 12. Which SQL keyword is used to retrieve a maximum value?

A) TOP
B) MOST
C) UPPER
D) MAX

Show Answer

Answer: Option D
Solution:
MAX function is used to get the maximum value from a column. To get the maximum salary drawn by an employee, the query would be:
SELECT MAX (salary) FROM employee;

Q 13. What is a view?

A) A view is a special stored procedure executed when certain event occurs.
B) A view is a virtual table which results of executing a pre-compiled query. A view is not part of the physical database schema, while the regular tables are.
C) A view is a database diagram.
D) None of these

Show Answer

Answer: Option B
Solution:
A VIEW is a virtual table, through which a selective portion of the data from one or more tables can be seen. A view do not contain data of their own. They are used to restrict access to the database or to hide data complexity. A view is stored as a SELECT statement in the database. DML operations on a view like INSERT, UPDATE, DELETE affects the data in the original table upon which the view is based.

The Syntax to create a sql view is:
CREATE VIEW view_name
AS
SELECT column_list
FROM table_name [WHERE condition];

view_name is the name of the VIEW.
The SELECT statement is used to define the columns and rows that you want to display in the view.

Q 14. Which of the following SQL commands is used to retrieve data?

A) DELETE
B) INSERT
C) SELECT
D) JOIN

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 15. Which of the following is a SQL aggregate function?

A) LEFT
B) AVG
C) JOIN
D) LEN

Show Answer

Answer: Option B
Solution:
SQL has several arithmetic functions to do math on the numbers, such as summing up, taking average, retrieved from the column. They are:
AVG():- Average of the column
COUNT():- Number of records
MAX():- maximum of the column
MIN():- minimum of the column
SUM():- Sum of the column

Q 16. Which SQL statement is used to update data in a database?

A) SAVE
B) UPDATE
C) SAVE AS
D) MODIFY

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 17. Which SQL statement is used to delete data FROM a database?

A) COLLAPSE
B) REMOVE
C) ALTER
D) DELETE

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 18. Which SQL keyword is used to sort the result-set?

A) SORT BY
B) ORDER
C) ORDER BY
D) SORT

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 19. The SQL statement
SELECT SUBSTR(‘123456789’, INSTR(‘abcabcabc’, ‘b’), 4) FROM DUAL;

A) 6789
B) 2345
C) 1234
D) 456789

Show Answer

Answer: Option B
Solution:
INSTR Function:- The INSTR function in SQL is used to find the starting location of a pattern in a string. The syntax for the INSTR function is as follows:
INSTR (str, pattern): Find the starting location of pattern in string str.

SUBSTR Function:- The Substring function in SQL is used to grab a portion of the stored data. The syntax for the SUBSTR function is as follows:
SUBSTR(str,pos,len): Starting with the position pos in string str select the characters upto the length len.

In the above query,
INSTR(‘abcabcabc’, ‘b’) outputs 2 as the starting location of pattern

Q 20. Which of the following group functions ignore NULL values?

A) MAX
B) COUNT
C) SUM
D) All of the above

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 21. Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.
The SQL statement
SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM EMPLOYEE);
prints

A) 10
B) 9
C) 5
D) 0

Show Answer

Answer: Option B
Solution:
ANY compares a value with each of the values in a list or results from a query and evaluates to true if the result of an inner query contains at least one row. ANY must be preceded by comparison operators(=, >, <, <=, >=, <>).

Employee table has 10 records and each value in non-NULL SALARY column is unique i.e different. So, in that 10 records one of the record will be minimum which cannot be greater than any nine value of the salary column. Hence the condition
WHERE SALARY > ANY (SELECT SALARY FROM employee)
will be true nine times. So, the COUNT(*) outputs 9.

Q 22. The SQL statement
SELECT SUBSTR(‘abcdefghij’, INSTR(‘123321234’, ‘2’, 3, 2), 2) FROM DUAL;
prints

A) gh
B) 23
C) bc
D) ab

Show Answer

Answer: Option A
Solution:
Another form of INSTR function used in ORACLE is:
INSTR (str, pattern, [starting position, [nth location]]): Finds the starting location of the nth occurrence of pattern beginning in the starting position-th position in string str.
Example: – SELECT INSTR(‘kolkata’, ‘a’, 1, 2) FROM DUAL;
will output 7 as the starting location of 2nd occurrence of pattern ‘a’ from starting position 1 in string ‘kolkata’ is 7.

In the above query INSTR(‘123321234’, ‘2’, 3, 2) will give the output 7 as the starting location of 2nd occurrence of pattern ‘2’ from starting location three in string ‘123321234’ is 7.

Now SUBSTR function becomes SUBSTR(‘abcdefghij

Q 23. The SQL statement
SELECT ROUND(45.926, -1) FROM DUAL;

A) is illegal
B) prints garbage
C) prints 045.926
D) prints 50

Show Answer

Answer: Option D
Solution:
The ROUND function in SQL is used to round a number to a specified precision. The syntax is:
ROUND (expression, [decimal place])
where [decimal place] indicates the number of decimal points returned. A negative number means the rounding will occur to the digit to the left of the decimal point. For example, -1 means the number will be rounded to the nearest tens.

For above given example, the output would be 50 because the nearest tens of 45.926, is 50.
Taking another example, if we have to round (44.678, -1), the out put would be 40, because the nearest tens of 44.678 is 40.

Q 24. Which of the following must be enclosed in double quotes?

A) Dates
B) Column Alias
C) Strings
D) All of the above

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 25. Which of the following command makes the updates performed by the transaction permanent in the database?

A) ROLLBACK
B) COMMIT
C) TRUNCATE
D) DELETE

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 26. Which command undo all the updates performed by the SQL in the transaction?

A) ROLLBACK
B) COMMIT
C) TRUNCATE
D) DELETE

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 27. Find all the cities whose humidity is 89

A) SELECT city WHERE humidity = 89;
B) SELECT city FROM weather WHERE humidity = 89;
C) SELECT humidity = 89 FROM weather;
D) SELECT city FROM weather;

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 28. Find the temperature in increasing order of all cities

A) SELECT city FROM weather ORDER BY temperature;
B) SELECT city, temperature FROM weather;
C) SELECT city, temperature FROM weather ORDER BY temperature;
D) SELECT city, temperature FROM weather ORDER BY city;

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 29. What is the meaning of LIKE ‘%0%0%’

A) Feature begins with two 0’s
B) Feature ends with two 0’s
C) Feature has more than two 0’s
D) Feature has two 0’s in it, at any position

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 30. Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy

A) SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’);
B) SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’);
C) SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’);
D) SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 31. Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70oF.

A) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70;
B) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70;
C) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70;
D) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70;

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 32. Find all the tuples having temperature greater than ‘Paris’.

A) SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’)
B) SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)
C) SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)
D) SELECT * FROM weather WHERE temperature > ‘Paris’ temperature

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 33. Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79

A) SELECT * FROM weather WHERE humidity IN (63 to 79)
B) SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)
C) SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
D) SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 34. Find the names of the countries whose condition is sunny.

A) SELECT country FROM location WHERE condition = ‘sunny’;
B) SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition = sunny’);
C) SELECT country FROM location WHERE city NOT IN (SELECT city FROM weather WHERE condition = ‘sunny’);
D) SELECT country FROM location WHERE city UNION (SELECT city FROM weather WHERE condition = ‘sunny’);

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 35. Find the name of all cities with their temperature, humidity and countries.

A) SELECT city, temperature, humidity, country FROM location;
B) SELECT weather.city, temperature, humidity, country FROM weather, location;
C) SELECT weather.city, temperature, humidity, country FROM weather, location WHERE weather.city = location.city;
D) SELECT weather.city, temperature, humidity FROM weather SELECT country FROM location WHERE weather.city = location.city;

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 36. Find the name of cities with all entries whose temperature is in the range of 71 and 89

A) SELECT * FROM weather WHERE temperature NOT IN (71 to 89);
B) SELECT * FROM weather WHERE temperature NOT IN (71 and 89);
C) SELECT * FROM weather WHERE temperature NOT BETWEEN 71 to 89;
D) SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 37. Which of the following query finds the names of the sailors who have reserved at least one boat?

A) SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
B) SELECT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
C) SELECT DISTINCT s.sname FROM sailors, reserves WHERE s.sid = r.sid;
D) None of These

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 38. Which of the following query finds colors of boats reserved by “Dustin”?

A) SELECT DISTINCT b.color FROM boats b, sailors s WHERE s.sname = ‘Dustin’ AND s.sid = b.sid
B) SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = ‘Dustin’ AND s.sid = r.sid AND r.bid = b.bid;
C) SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = ‘Dustin’ AND s.sid = r.sid
D) SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = ‘Dustin’ AND r.bid = b.bid

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 39. What does the following query find?
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = ‘red’)
MINUS
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = ‘green’)

A) Find the sailor IDs of all sailors who have reserved red boats but not green boats
B) Find the sailor IDs of at least one sailor who have reserved red boats but not green boats
C) Find the sailor Ids of atmost one sailor who have reserved red boats but not green boats
D) None of These

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 40. Which of the following query finds the name of the sailors who have reserved at least two boats?

Q 41. Which of the following query finds the total rating of the sailors who have reserved boat “103”?

A) SELECT SUM(s.rating) FROM sailors s, reserves r AND r.bid = 103;
B) SELECT s.rating FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
C) c) SELECT COUNT(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
D) SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 42. The SELECT statement SELECT ‘Hi’ FROM DUAL WHERE NULL = NULL; Outputs

A) Hi
B) FLASE
C) TRUE
D) Nothing

Show Answer

Answer: Option D
Solution:
Since Null is not a member of any data domain, it is not considered a “value”, but rather a marker (or placeholder) indicating the absence the value. Because of this, comparisons with Null can never result in either True or False, but always in a third logical result,as Unknown. So, comparing NULL with NULL results to NULL.

Q 43. Which of the following is illegal?

A) SELECT SYSDATE – SYSDATE FROM DUAL;
B) SELECT SYSDATE – (SYSDATE – 2) FROM DUAL;
C) SELECT SYSDATE – (SYSDATE + 2) FROM DUAL;
D) None of these

Show Answer

Answer: Option D
Solution:
SELECT SYSDATE – SYSDATE FROM DUAL; outputs 0
SELECT SYSDATE – (SYSDATE – 2) FROM DUAL; outputs 2
SELECT SYSDATE – (SYSDATE + 2) FROM DUAL; outputs -2

Q 44. If a query involves NOT, AND, OR with no parenthesis

A) NOT will be evaluated first; AND will be evaluated second; OR will be evaluated last.
B) NOT will be evaluated first; OR will be evaluated second; AND will be evaluated last.
C) AND will be evaluated first; OR will be evaluated second; NOT will be evaluated last.
D) The order of occurrence determines the order of evaluation.

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 45. Let the statement
SELECT column1 FROM myTable;
return 10 rows. The statement
SELECT ALL column1 FROM myTable;
will return

A) less than 10 rows
B) more than 10 rows
C) exactly 10 rows
D) None of these

Show Answer

Answer: Option C
Solution:
ALL are optional. Its presence or absence doesn’t change the output. Unlike DISTINCT, it allows duplicates in the output.

Q 46. Table employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.
The SQL statement
SELECT COUNT(*) FROM employee WHERE SALARY > ALL (SELECT SALARY FROM EMPLOYEE);
prints

A) 10
B) 9
C) 5
D) 0

Show Answer

Answer: Option D
Solution:
This query counts the number of employees who gets more than the maximum salary.

Q 47. Which of the following SQL commands can be used to add data to a database table?

A) ADD
B) UPDATE
C) APPEND
D) INSERT

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 48. Which of the following join is also called as an ‘inner-join’?

A) Non-Equijoin
B) Self-Join
C) Equijoin
D) None of these

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 49. Which of the following is NOT a type of SQL constraint?

A) PRIMARY KEY
B) ALTERNATE KEY
C) FOREIGN KEY
D) UNIQUE

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 50. What is an SQL virtual table that is constructed from other tables?

A) view
B) A relation
C) Just another table
D) Query results

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 51. When using the SQL INSERT statement:

A) rows cannot be copied in mass from one table to another only.
B) rows can be modified according to criteria only.
C) rows can either be inserted into a table one at a time or in groups.
D) rows can be inserted into a table only one at a time only.

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 52. The SQL ALTER statement can be used to:

A) change the table data.
B) change the table structure.
C) delete rows from the table.
D) add rows to the table.

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 53. What SQL command can be used to delete columns from a table?

A) MODIFY TABLE TableName DROP ColumnName
B) MODIFY TABLE TableName DROP COLUMN ColumnName
C) ALTER TABLE TableName DROP ColumnName
D) ALTER TABLE TableName DROP COLUMN ColumnName

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 54. What SQL command can be used to add columns to a table?

A) ALTER TABLE TableName ADD ColumnName
B) ALTER TABLE TableName ADD COLUMN ColumnName
C) MODIFY TABLE TableName ADD ColumnName
D) MODIFY TABLE TableName ADD COLUMN ColumnName

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 55. The command to remove rows from a table ‘CUSTOMER’ is:

A) DROP FROM CUSTOMER …
B) UPDATE FROM CUSTOMER …
C) REMOVE FROM CUSTOMER …
D) DELETE FROM CUSTOMER WHERE …

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 56. The SQL WHERE clause:

A) limits the row data are returned.
B) limits the column data that are returned.
C) Both A and B are correct.
D) Neither A nor B are correct.

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 57. Which of the following is the original purpose of SQL?

A) To define the data structures
B) To specify the syntax and semantics of SQL data definition language
C) To specify the syntax and semantics of SQL manipulation language
D) All of the above.

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 58. The wildcard in a WHERE clause is useful when?

A) An exact match is necessary in a CREATE statement.
B) An exact match is necessary in a SELECT statement.
C) An exact match is not possible in a SELECT statement.
D) An exact match is not possible in a CREATE statement.

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 59. The command to eliminate a table from a database is:

A) DROP TABLE CUSTOMER;
B) DELETE TABLE CUSTOMER;
C) REMOVE TABLE CUSTOMER;
D) UPDATE TABLE CUSTOMER;

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 60. The SQL keyword(s) ________ is used with wildcards.

A) NOT IN only
B) LIKE only
C) IN only
D) IN and NOT IN

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 61. A subquery in an SQL SELECT statement is enclosed in:

A) parenthesis — (…).
B) brackets — […].
C) CAPITAL LETTERS.
D) braces — {…}.

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 62. The result of a SQL SELECT statement is a ________ .

A) file
B) report
C) table
D) form

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 63. In an SQL SELECT statement querying a single table, according to the SQL-92 standard the asterisk (*) means that:

A) all columns of the table are to be returned.
B) all records meeting the full criteria are to be returned.
C) all records with even partial criteria met are to be returned.
D) None of the above is correct.

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

Q 64. The HAVING clause does which of the following?

A) Acts EXACTLY like a WHERE clause.
B) Acts like a WHERE clause but is used for columns rather than groups.
C) Acts like a WHERE clause but is used for groups rather than rows.
D) Acts like a WHERE clause but is used for rows rather than columns.

Show Answer

Answer: Option C

No explanation is given for this question Let’s Discuss on Board

Q 65. Which of the following do you need to consider when you make a table in SQL?

A) Data types
B) Primary keys
C) Default values
D) All of the above.

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 66. When three or more AND and OR conditions are combined, it is easier to use the SQL keyword(s):

A) NOT IN only.
B) LIKE only.
C) IN only.
D) Both IN and NOT IN.

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 67. SQL can be used to:

A) create database structures only.
B) query database data only.
C) modify database data only.
D) All of the above can be done by SQL.

Show Answer

Answer: Option D

No explanation is given for this question Let’s Discuss on Board

Q 68. The SQL keyword BETWEEN is used:

A) to limit the columns displayed.
B) for ranges.
C) as a wildcard.
D) None of these is correct.

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 69. Which of the following query is correct for using comparison operators in SQL?

A) SELECT name, course_name FROM student WHERE age>50 and <80; B) SELECT name, course_name FROM student WHERE age>50 and age <80; C) SELECT name, course_name FROM student WHERE age>50 and WHERE age<80;
D) None of these

Show Answer

Answer: Option B

No explanation is given for this question Let’s Discuss on Board

Q 70. How to select all data from student table starting the name from letter ‘r’?

A) SELECT * FROM student WHERE name LIKE ‘r%’;
B) SELECT * FROM student WHERE name LIKE ‘%r%’;
C) SELECT * FROM student WHERE name LIKE ‘%r’;
D) SELECT * FROM student WHERE name LIKE ‘_r%’;

Show Answer

Answer: Option A

No explanation is given for this question Let’s Discuss on Board

If you like CBSEToaday and would like to contribute, you can also write an article using submit article or mail your article to contribute@cbsetoday.com See your article appearing on the cbsetoday.com main page and help other students/teachers.