Zybooks Questions Flashcards

(40 cards)

1
Q

When to use DISTINCT keyword?

A

To remove duplicate values from query results

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

When to use UNIQUE keyword?

A

Constraint on column to make sure they only contain unique values

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

What is Data Definition Language (DDL)?

A

Defines database structure ie CREATE TABLE

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

What is Data Query Language (DQL)?

A

Retrieves data ie SELECT

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

What is Data Manipulation Language (DML)?

A

Inserts, updates, deletes in database

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

_____ may appear in each cell.

A

Exactly one value

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

What is the correct statement format to drop a table?

A

DROP Table tableName;

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

What is the statement to do the following – Delete the column ShortDesc. from Deparment table?

A

ALTER TABLE Department DROP ShortDesc;

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

What are WITH CHECK OPTIONS?

A

Database rejects inserts and updates that do not satisfy the view query

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

What is CHECK when used with a constraint?

A

A way to check if values meet a condition

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

How do you add or change constraint on an existing column?

A

Use CHANGE —- CHANGE table column datatype constraint. This is for unnamed constraints

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

How do you add a named constraint to an existing column?

A

Use ADD CONSTRAINT in an ALTER TABLE statement

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

Can you add a value with NULL?

A

NO

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

________ languages contain control flow statements but no classes

A

Procedural

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

_____ is the leading declarative language.

A

SQL

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

SQL uses many keywords, like SELECT, FROM, and WHERE. C relies heavily on punctuation, like {} and #. This is an example of the ______ gap.

A

Syntax

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

The EXEC SQL keyword is used in procedural SQL. T/F

18
Q

Usually generates a network round trip for each SQL query.

19
Q

Affords the greatest database security.

A

Procedural SQL

20
Q

Which form of SQL needs a precompiler

21
Q

Most Procedural SQL languages implement the entire SQL/PSM standard T/F

22
Q

First character in a user-defined variable.

23
Q

Consists of a simple or compound statement.

24
Q

May appear in the body of a stored procedure.

25
Precedes a parameter name in a .
INOUT
26
Optional in CREATE PROCEDURE statements.
27
Stored functions may be executed from the MySQL command line. T/F
True
28
The has the same syntax in stored procedures and stored functions T/F
False
29
All embedded SQL statements require an active connection. T/F
True
30
Shared variables can appear in which clause of an embedded SELECT statement?
Both INTO and WHERE clauses
31
In the declaration section, shared variables are assigned a data type in:
The host language
32
The ________ statement associates a cursor name with a query.
DECLARE
33
The _____ statement assigns query results to shared variables.
FETCH
34
The ________ statement positions a cursor before the first row of a result table.
OPEN
35
A(n) _______ statement must appear before an EXECUTE statement without the IMMEDIATE keyword.
PREPARE
36
Shared variables appear in an EXECUTE statement with the ______ clause
USING
37
Statements that are written explicitly in program code are ______ SQL.
static
38
The precompiler cannot compile ______ SQL statements.
dynamic
39
The executeQuery() method:
Both compiles and executes an SQL statement.
40
In the Informix set type, the base type must be a group of character strings T/F
False