1. What is the typical filename extension of a SQL file?
2. What is the name of the category of functions used to summarize data?
3. Where is the GROUP BY clause placed in the sequence of statements?
4. If a foreign key constraint is violated, the default action taken by the DBMS is what?
5. What is the first query to run in a statement that contains subqueries?
6. Which is the correct order for a proper SQL query?
7. What is the proper syntax of the keyword LIMIT to display 5 results after starting at record 4?
8. What is the correct procedure to create and use a cursor?
9. What records would the result set of this query include? SELECT * FROM tableA LEFT OUTER JOIN tableB ON tableA.key = tableB.key
10. Which wildcard character means "match any number of occurrences of any character"?
11. What is the name of a result that returns all the rows in all the tables listed in the query?
12. UNION ALL is different from a UNION command in that...
13. Which of the following is NOT an explicit data type reference?
14. The UNION ALL operator performs which of the following actions?
15. What keyword is used with aggregate functions to include every value in the calculation?
16. Indexes can be created on existing tables so that information can be retrieved more quickly. Specifically, what are indexes created on?
17. Which does not describe a database element?
18. Choose correct clause: SELECT CountryCode, COUNT(*) FROM City GROUP BY CountryCode _____ COUNT(*) > 20;
19. What is the result of "select * from table where 1"
20. This example illustrates use of the FULL JOIN action. Which clauses must fill the three blanks for the query to be valid? _______ e1."Event_Name", v2."Venue" FROM "events" e1 _______ "venues" v2 ON (e1."VenueNo" = v2."VenueNo") _______ e1."Event_Name" ASC, v2."Venue" ASC
21. What is PL/SQL?
22. Which of the following query will return PERSON first_name from table PERSON with last_name field null?
23. Which statement removes all rows from the "orders" table without removing the table structure?
24. What is the default join type if omitted?
25. What KEYWORD is used to filter groups?
26. Which of these is NOT a valid data type for a character string?
27. What is the function that combines two strings and returns the combined string?
28. Suppose table A has 5 rows and table B has 6 rows. You perform a cross join on these two tables. How many rows will it have?
29. Which clause indicates the table(s) from which data is to be retrieved?
30. What data is this statement trying to query from the Customers Table? SELECT * FROM Customers WHERE City LIKE '[!bsp]%'
31. Which of the following is NOT true about a primary key constraints?
32. Which will select the `name` of 'John' from the 'Person' table where `num_friends` is greater than 1?
33. How do you select a column named "FirstName" from a table named "Persons"?
34. Which statement can be used to repeat the execution of a code block as long as a specified condition returns TRUE?
35. SELECT * FROM tablea, tableb WHERE tablea.DepartmentID = tableb.DepartmentID; Which of these keywords will have the same effect as the above query?
36. The DDL term "DROP" does what?
37. What character is used to connect a table name with a column name to create a fully qualified column name?
38. What is the term for a column (or set of columns) whose values uniquely identify every row in a table?
39. What is the term for a set of data elements (values) organized using rows and columns?
40. The HAVING clause can be used for what purpose?
41. True or False? This query is valid the way it is structured. SELECT * FROM Prospects WHERE assignment_type <> 'Team' AND criteria is not null
42. What clause is used to sort data and group it?
43. What keyword is used to check for a range of values?
44. What happens if you omit the WHERE clause in a SQL DELETE query?
45. Which symbol can be used to indicate a "wild card" to substitute for one or more characters when searching for string in a database?
46. Which of the following are type(s) of DML Triggers?
47. The HAVING clause is used in conjunction with (and immediately after) what other clause?
48. What keyword is used to create a table alias?
49. What is the correct syntax to concatenate the contents of one column (col1) to the contents of another column (col2) in a query?
50. Which of the following names is NOT a SQL based RDBMS?
51. Which keyword is used more than once in a SQL statement that contains a subquery?
52. An asterisk after SELECT can be used to return all ________ of a table.
53. What keyword is used with aggregate functions to include only unique values in the calculation?
54. What is the name of a mechanism used to associate tables within a SELECT statement?
55. What is the name for a query embedded inside another query?
56. How many primary keys can a table have?
57. What syntax would you use to write a query to select all teams that won either 2, 4, 6 or 8 games?
58. What keyword is used in conjunction with the WHERE clause when creating a subquery?
59. What term is used to describe the "layout" of a database or the blueprint that outlines the way data is organized into tables?
60. What function calculates a column's average value?
61. In SQL what is the meaning of NULL?
62. Which of the following is NOT a language element of SQL?
63. What is one of the purposes of normalization?
64. If tableA is CROSS JOINED to tableB, tableA has 10 rows and tableB has 5 rows, what is the greatest possible size of the result set?
65. Which of the following is the correct syntax to update a table?
66. A primary key made up of more than one column is referred to as what kind of key?
67. Which keyword is used to sort retrieved data in reverse order?
68. What is the difference with using IN or equal(=) operator to filter records?
69. Which SQL function or feature returns a single value, calculated from values in a column?
70. What does RDBMS mean?
71. =, <>, >, <, >=, <=, BETWEEN, LIKE, and IN are referred to as _____
72. What is one objective of database normalization?
73. Which of the following statements can be used to undo a transaction?
74. What is the difference between DROP and DELETE.
75. What function is used to remove padded spaces?
76. Which aggregate function returns the total of the values in a column?
77. You can add a row using SQL in a database with which of the following?
78. What does the acronym SQL stand for?
79. When accessing data from a table which keyword is used immediately before the table name? (Example: SELECT column_name _______ table_name;)
80. What is the definition of a foreign key?
81. What is another name for a table row?
82. The 'JOIN' keyword is used to:
83. The FROM keyword is used to identify which piece of information?
84. What function returns the lowest value in a column?
85. Which keyword is used to assign an alias?
86. Which keyword is used to retrieve only certain rows of data?
87. Which of the following is NOT a valid aggregate function?
88. When sorting by multiple columns, which character is used to separate column names?
89. What keyword is used to check for no value?
90. True or False: All SQL queries must contain a WHERE clause.
91. The command to remove rows from a table 'CUSTOMER' is:
92. Which command is used to sort retrieved data?
93. Which of the following is NOT included as a field in the timestamp data type?
94. What keyword is used to retrieve table data?
95. What is DDL Stand for?
96. True or false The ORDER BY keyword is used to sort the result-set by one or more columns.
97. What statement must be placed in the blank space at the beginning of this query in order for it to be valid? ______ Movie.title, COUNT(*) AS Directors FROM Movie JOIN Movie_director ON Movie.isbn = Movie_director.isbn GROUP BY Movie.title
98. Of the following sequences which one is in the correct order?
99. True or False: An ORDER BY clause is optional in a query.
100. Which character is used to end a SQL statement?
101. Which of the following is NOT a basic SQL statement?
102. Which character is used to retrieve all columns of data?
103. What function counts the number of rows in a column?
104. What function returns the highest value in a column?
105. What of the following is an operator for nonequality?
106. What visual technique is commonly used to format subqueries?
107. A trigger is a database object that is attached to a table. It is most similar to what other database process?
108. Which of the following DROP statements is incorrect?
109. What keyword is used in conjunction with the INNER JOIN keywords to return rows when there is at least one match in both tables?
110. What is a common schema name?
111. What is the difference between WHERE and HAVING clauses?
112. What is an alternate way of writing the following statement: WHERE "column_name" IN ('value1')
113. Must CASE statements always be indented?
114. Which type of join will yield a Cartesian product?
115. Where can we find subquery within another statement?
116. What is the correct syntax for using a CASE statement?
117. What is a phantom read?
118. Which of the following is a valid isolation level?
119. Which is the lowest isolation level to ensure dirty reads can not happen
120. If you INNER JOIN tableA (which has 10 rows) with tableB (which has 5 rows), what is the smallest possible amount of rows that can be returned?
121. Which of the following statements about indexes is NOT correct?
122. Which is the only proven way to prevent SQL Injection
123. Which of these is not a valid constraint?
124. How many clustered indexes can a table have?
125. What is a collation?
126. Which of the following types of triggers can be used with a view?
127. Which of the following KEYWORDS will return the first NON-NULL value from a list of columns?
128. which of the following is NOT a SQL wildcard
129. What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()
130. What is the difference between a unique key and primary key?
131. How can you insert several records in TABLE1 that already exist in TABLE2?
132. What code would find the position of the character 'D' in the string 'ABCDE' - starting at position 1?
133. A recursive CTE would contain which of the following?
134. Which is the highest isolation level?
135. Which statement about non-clustered index is true?
136. How can you prevent a phantom read?
137. How many TRIGGERS are allowed in MySql table
138. What is the equivalent sql statement of following statement? Select sum(column1) a, count(column2) b from TableA where 1=2
139. What is executed first in SQL?
140. what does the following sql statement do? SELECT TOP(10) WITH TIES Name, Salary FROM Employees ORDER BY Salary DESC
141. When using logical (truth value) operations, how many logical results are there and what are they?
142. Which statement can be used to encrypt data in SQL?
143. Other things being equal, which queries are the fastest?
144. With SQL, how do you select all the records from a table named "Companys" where the value of the column "Name" ends with an "d"?
145. When an aliases is used to rename a table in a particular SQL statement. The actual table name in the database is also renamed?
146. How to create indexes?
147. What is the Difference between Varchar and Char Datatypes in SQL?
148. What's the difference between "_" and "%" in sql wildcard
149. How do you select the first record of a table?
150. What is function for adding all the records of a column?
151. SELECT Customers.* FROM Customers LEFT OUTER JOIN Sales ON Customers.CustNo = Sales.CustNo What columns does this query return?
152. SELECT dg.* FROM dgpricing dg LEFT OUTER JOIN icitem ic ON dg.Partno = ic.Item What columns does this query return?
153. How to Extract characters from a text field?
154. TRUE/FALSE. All of the SQL language, syntax, and commands are universal across all major database platforms (Oracle, MySQL, and MS-SQL).
155. How many types of indexes?
156. Which of the following cannot be used in a subquery?
157. what keyword below can replace NOT EXIST in SQL
158. what listing does represent a form of SQL
159. How many Oracle installations does it take to execute a query?
160. What is T/SQL?
161. Complete the sentence: SELECT animals ______ types WHERE id = 5;
162. All the following are properties of the Relational tables expect
163. How can you improve the execution speed of the following query: Select * from Products Where City like '%gen%'
164. After describing the EMPLOYEES table, you discover that the SALARY column has a data type of NUMBER(8,2). Which SALARY value(s) will not be permitted in this column?
165. Which of the following only works with GROUP BY clause?
166. Referential Integrity means that among relations
167.
Consider the following Attendance table which contains an employee attendance record for a company:
EmployeeID (int), LoginTime (time), LogoutTime (time)
Which of these SELECT statements will list the employee ID that has logged-in most recently?
168.
How would you create a table with one column having Integer precision of 10?
169. Which of the following is true for creating SQL Views? (check any that apply)
170. What is the difference between decimal and numeric data types?
171. Which of the following is not true about the COMMIT command?
172.
What will be the output of the following query?
SELECT SUBSTRING('987654321', INSTR('foobar', 'o'), 5) from DUAL;
173.
SELECT (ROUND(3.5 MOD 4)) from DUAL;
174. Which query can be used to copy all records from table1 into table2 provided they have the same columns?
175. Which of the following operators can be used to check if a column contains NULL value?
176. Which of the following commands is used to explain access to data?
177.
For a table with the following columns:
product_id, product_name, supplier_id, price
Which of the following queries will give you the supplier with the maximum average price of products?
178. To create a column in a table with a fixed length(n) string, which of the following data type is recommended?
179. Which of the following clauses can be included in SELECT to fetch 10 records only? (Check all that apply)
180. To speed up searches in tables we can?
181.
Consider two tables A and B, having only one column each and having these values:
A = [0, 1, 2, 3, 4, 5]
B = [5, 6, 7, 8, 9, 10]
The result of the UNION ALL operator on these tables will be?
182.
Which of the following command will work as per below statement
"We need to replace a string named "foo" with "bar" in a column having ID <= 4"
183. Which of the following is not a DDL Command?
184. Which of the following is not a DDL command?
185. To create a table column which should not accept blank values, which of the following can be used?
186. What does MID() function do?
187. What keyword is used to filter values obtained by applying aggregate functions in the query results using GROUP BY clause?
188.
Assuming there are multiple rows in the 'Commission_Agents' table with entries for commission agents from different departments, what is the error in the following query:
SELECT name, department_id, commission_percentage from Commision_Agents
WHERE commission_percentage = (SELECT min(commission_percentage) FROM Commision_Agents GROUP BY department_id);
189. What is the difference between CHAR and VARCHAR data types?
190. Which of the following operators can not be used in the 'WHERE' clause?
191. Which of the following statements is/are true?
192. Which of the following is not a valid SQL operator?
193.
For a table with the following data:
Name Marks
John 400
Brown 200
Darwin 350
Kamy 250
Which of the following queries will give you names of all students having above average marks?
194. Which of the following SQL commands can be included to sort data?
195. Which of the following SQL commands can use a foreign key constraint? (check any that apply)
196. Which of the following is not a DDL statement?
197. If AND and OR are used after WHERE clause ...
198.
Suppose a table CUSTOMERS has the following records:
+---+--------+----------+
| ID | CUSTOMER| INCOME |
+----+---------+---------+
| 1 | Roman | 150000 |
| 2 | Andrew | 200000 |
| 3 | Christi | 240000 |
| 4 | Ivan | 240000 |
| 5 | John | 240000 |
| 6 | Ann | 240000 |
+----+---------+---------+`
Which of the following statements will select the customers with income more than 200000? (check any that apply)
199. Which one of the following is the correct way to delete a column from a table?
200.
Consider two tables A and B having only one column each and having these values:
The number of records in result of UNION operator on these tables will be?
201. Transactions, if available, wrap ___ operations.
202. Which of the following is the name of ** operator?
203. Which of the following functions are related to XML? (check any that apply)
204.
Suppose you have the following table with columns:
+------+------+------------+--------------------+
| id | name | work_date | salary |
| 1 | John | 2016-01-24 | 300 |
To get an output like '1John2016-01-24' which of the following functions can be used?
205. Which of the following can be used to delete all the data from a table?
206. Which of the following is an SQL operator?
207. Which operator allows you to specify multiple values in a WHERE clause?
208. Which of the following can you not do with SQL?
209. Is there a difference between AND and & (ampersand) in SQL?
210. If a column is defined as decimal(5,2), what does that mean?
211. Which statement INSERTS or UPDATES based on the given conditions?
212. Which of the following can be used with LIKE operator?
213.
Which of the following is the correct syntax for writing sub query?
214. Which of the following is not a comparison operator in SQL?
215. Which of the following is an internet media type for SQL? (check any that apply)
216. All statements in SQL end with:
217. A ____ is a pointer to a row in the collection of rows retrieved by an sql command.
218. A ____ query creates a new table using the query results.
219. A ________ is a temporary table used in the from clause of an sql query.
220. A dbms lets you assign users to ____.
221. All join conditions are connected through a(n) _____ logical operator.
222. Columns in a database table contain data with the same _________.
223. Commands used to modify data are called ____ commands.
224. If you have three different transitive dependencies, _____ different determinant(s) exist.
225. In access sql, the ____ is used as a wildcard to represent any individual character.
226. In an entity-relationship (e-r) diagram, ____ are used to represent an entity.
227. In many languages the case structure is called a ________ statement.
228. In oracle, the ____ table contains information about the tables known to sql.
229. In oracle, the _____ function converts a date to a character string.
230. In oracle, use the ____ command to display the structure of a table.
231. In sql server, you can use the ____ function to obtain today’s date.
232. In sql, use the ____ data type for variable-length character columns.
233. In sql, you use the ____ command to query a database.
234. In subquery terminology, the first query in the sql statement is known as the _____ query.
235. In the select clause, you can use the ____ symbol to indicate that you want to include all columns.
236. Insert, update, and delete statements can be referred to as ______________ queries.
237. Microsoft azure sql is an example of a _________________ database.
238. Oracle and sql server support the ____ operator but microsoft access does not.
239. Popular ____ include access, oracle, db2, mysql, and sql server.
240. Sql ________ statements may change the contents of a database.
241. Sql is an example of a ________ style of programming language.
242. Sql links tables together by ________.
243. Sql queries that use exists and not exists are ________.
244. Sql requires the use of the _____ command to enter data into a table.
245. Sql uses search operators such as ____ to form complex queries.
246. Sql was developed in the mid-____.
247. The structure of the table can be displayed with the _________ command:
248. The _____ command restricts the selection of grouped rows based on a condition.
249. When you use the ____ function, you can use the asterisk (*) to represent any column.
250. You can join tables by using a condition in the ____ clause.
251. You can save the results of a query as a table by including the ____ clause in the query.
252. You can use the ____ command to create a new table using data in an existing table.
253. You indicate the end of a command by typing a ____.
254. The ____ operator is used to determine whether a condition is present in a subquery.
255. The ____ operator specifies a range of values in a condition.
256. The ____ operator uses one or more wildcard characters to test for a pattern match.
257. The ____ wildcard symbol represents any individual character.
258. The _____ command replaces the ***** in the syntax of the update command, shown above.
259. The _____ operator could be used in place of minus if the dbms does not support it.
260. The ________ keyword is required to use relational operators in a case statement.
261. The action of including only some columns for output while retrieving data is known as ____.
262. The ansi standard defines _____ type(s) of outer join(s)
263. The ____ clause lets you group data on a particular column.
264. The ____ command is permanent.
265. The ____ command is used with the alter table command to modify the table by deleting a column.
266. The ____ data type is used to store integers.
267. The ____ data type stores only the actual character string.
268. The ____ data type would be appropriate for a fixed-length field designed to hold a person’s name.
269. The ____ function calculates a total of the values in a column.
270. The ____ function determines the number of rows in a table.
271. The basic form of an sql retrieval command is ____.
272. The sql command ________ adds one or more new columns to a table.
273. The sql command ________ defines a logical table from one or more tables or views.
274. To include all fields in a sql query, use the ____ symbol after the word select.
275. To add data from an existing table to a new table, use a select command in a(n) ____ command.
276. In oracle, the ____ table contains information about the columns within tables.
277. The syntax for the union query is ____.
278. A ____ file is a text file with a .sql extension that contains sql commands.
279. Insert into is an example of ________ code.
280. Only one ____ constraint can exist for each table.
281. The sql ________ statement allows you to combine two different tables.
282. The sql command that lets you insert rows into a table is ____.
283. The sql command that lets you select attributes from rows in one or more tables is ____.
284. The syntax for a left outer join is ____.
285. The correct data type for the balance column in the customer table is ____.
286. To assign a conditional value, use the ____ function.
287. An index can be created ____.
288. The ____ special operator is used to check whether an attribute value is null.
289. The system catalog is also called the ____.
290. ____ is one of the categories of update anomalies.
291. The maximum width of the number datatype is ____ digits.
292. The command to delete a view is ____.
293. In microsoft access, the ____ function displays a value in lowercase letters.
294. The operators =, <, >, <=, >=, and <> are referred to as ____ operators.
295. To list all the contents of the product table, you would use ____.
296. Use the ____ keyword to enter the computer's date as a data value in the insert command.
297. You can use the ____ command to delete an entire table and its data.
298. When using a(n) _____ join, only rows that meet the given criteria are returned.
299. Access does not support the ____ data type.
300. In today's decentralized business world, ________ the most important strategic decisions.