SQL Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

The command to eliminate a table from a database is:

A

Correct Answer: DROP TABLE CUSTOMER;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

Correct Answer: LIKE only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A view is ……….?

A

A virtual table that can be accessed via SQL commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The wildcard in a WHERE clause is useful when?

A

An exact match is not possible in a SELECT statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name five built-in functions provided by SQL?

A

COUNT, SUM, AVG, MAX, MIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A subquery in an SQL SELECT statement is enclosed in:

A

parenthesis – (…) .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The result of a SQL SELECT statement is a(n) form/table/row/array

A

table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following is NOT a SQL keyword or SQL clause?

insert/update/invert/limit

A

invert

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which SQL function is used to count the number of rows in a SQL query?

A

COUNT()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which of the following is valid SQL for an Index?

Add index/Create index/let index

A

CREATE INDEX ID;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When three or more AND and OR conditions are combined, it is

easier to use the SQL keyword(s):

A

Both IN and NOT IN.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A subquery in an SQL SELECT statement:

a) has a table having query
b) has a distinct form that cannot be duplicated by a join.
c) has a view

A

has a distinct form that cannot be duplicated by a join.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

SQL query and modification commands make up a(n) ________ .

A

DML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The HAVING clause does which of the following?

A

Acts like a WHERE clause but is used for groups rather than rows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When the SQL keyword BETWEEN is used?

A

for ranges.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

SELECT 12 * 2 + 24;

A

48

17
Q

Do the following statements return the same or different output?
SELECT * FROM EMPLOYEES;
Select * from employees;
select * FROM employees;

A

Same output

18
Q

Which of the following is not a SQL transaction statement?

insert/rollback/commit

A

insert

19
Q

Question: 8 Which of the following is a valid way to add comments to a SQL statement?

a) – this is comment
b) //this is comment
c) –> this is comment

A

a)– this is comment

20
Q

What does the ALTER TABLE statement do?

A

Use to change the structure of an existing table.