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

A

True

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.

A

True

18
Q

SQL is a data sublanguage. T/F

A

True

19
Q

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

A

True

20
Q

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

A

True

21
Q

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

A

True

22
Q

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

A

True

23
Q

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

A

True

24
Q

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

A

True

25
Q

The result of every SQL query is a table. T/F

A

True

26
Q

The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column. T/F

A

True

27
Q

A dynamic view is one whose contents materialize when referenced. T/F

A

True

28
Q

What is the correct order of keywords for SQL SELECT statements?

A

SELECT, FROM, WHERE

29
Q

SQL data definition commands make up a(n) _______.

A

DDL

30
Q

What is DDL?

A

Data Definition Language; deals with database schemas and descriptions of how the data should resides in the database

31
Q

What are examples of DDL commands?

A

CREATE, ALTER, DROP, TRUNCATE, COMMENT, and RENAME

32
Q

What is DML?

A

Data Manipulation Language; deals with data manipulation used to story, modify, retrieve, delete, and update data in database

33
Q

What are examples of DML commands?

A

SELECT, INSERT, UPDATE, DELETE, MERGE, LOCK TABLE

34
Q
A
35
Q

What is the original purpose of SQL?

A

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