Intro to SQL Flashcards

1
Q

SQL can be used to:

A

create database structures and modify & query database data

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

Find the SQL statement below that is equal to the following: SELECT NAME FROM CUSTOMER WHERE STATE =’VA’;

A

SELECT NAME FROM CUSTOMER WHERE STATE IN (‘VA’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
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
4
Q

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

A

LIKE only

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

To define what columns should be displayed in an SQL SELECT statement:

A

use FROM to name the source table(s) and list the columns to be shown after SELECT

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

What does the HAVING clause do?

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
7
Q

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

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

A subquery in an SQL SELECT statement:

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
9
Q

Which of the following is valid SQL for an Index?

A

CREATE INDEX ID;

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

SQL is:

A

a data sublanguage

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

What is a view?

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
12
Q

The SQL statement that queries or reads data from a table is ____.

A

SELECT

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

The result of a SQL SELECT statment is a(n) _____.

A

table

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

The SELECT command, with its various clauses, allows users to query the data contained in the tables and ask many different questions or ad hoc queries. T/F

A

True

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

To establish a range of values, can be used. T/F

A

True

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

Most companies keep at least two versions of any database they are using. T/F

17
Q

If you are going to use a combination of of three or more AND and OR conditions, it is often easier to use the NOT and NOT IN operators.

18
Q

SQL is a data sublanguage. T/F

19
Q

The HAVING clause acts like a WHERE clause, but it identifies groups that meet a criterion, rather than rows. T/F

20
Q

Indexes may be created or dropped at any t ime. T/F

21
Q

SQL provides five built-in functions: COUNT, SUM, AVG, MAX, MIN. T/F

22
Q

The keyword BETWEEN can be used in a WHERE clause to refer to a range of values. T/F

23
Q

The qualifier DISTINCT must be used in an SQL statement when we want to eliminate duplicate rows. T/F

24
Q

The format SELECT-FROM-WHERE is the fundamental framework of SQL SELECT statements. T/F

25
The result of every SQL query is a table. T/F
True
26
The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column. T/F
True
27
A dynamic view is one whose contents materialize when referenced. T/F
True
28
What is the correct order of keywords for SQL SELECT statements?
SELECT, FROM, WHERE
29
SQL data definition commands make up a(n) _______.
DDL
30
What is DDL?
Data Definition Language; deals with database schemas and descriptions of how the data should resides in the database
31
What are examples of DDL commands?
CREATE, ALTER, DROP, TRUNCATE, COMMENT, and RENAME
32
What is DML?
Data Manipulation Language; deals with data manipulation used to story, modify, retrieve, delete, and update data in database
33
What are examples of DML commands?
SELECT, INSERT, UPDATE, DELETE, MERGE, LOCK TABLE
34
35
What is the original purpose of SQL?
To specify the syntax and semantics of SQL manipulation language, to define the data structures, and to specify the syntax and semantics of SQL data definition language