Zybooks Questions Flashcards

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.

A

Embedded SQL

19
Q

Affords the greatest database security.

A

Procedural SQL

20
Q

Which form of SQL needs a precompiler

A

Embedded SQL

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
Q

Precedes a parameter name in a <parameter-declaration>.</parameter-declaration>

26
Q

Optional in CREATE PROCEDURE statements.

A

<parameter-declaration>
</parameter-declaration>

27
Q

Stored functions may be executed from the MySQL command line. T/F

28
Q

The <parameter-declaration> has the same syntax in stored procedures and stored functions T/F</parameter-declaration>

29
Q

All embedded SQL statements require an active connection. T/F

30
Q

Shared variables can appear in which clause of an embedded SELECT statement?

A

Both INTO and WHERE clauses

31
Q

In the declaration section, shared variables are assigned a data type in:

A

The host language

32
Q

The ________ statement associates a cursor name with a query.

33
Q

The _____ statement assigns query results to shared variables.

34
Q

The ________ statement positions a cursor before the first row of a result table.

35
Q

A(n) _______ statement must appear before an EXECUTE statement without the IMMEDIATE keyword.

36
Q

Shared variables appear in an EXECUTE statement with the ______ clause

37
Q

Statements that are written explicitly in program code are ______ SQL.

38
Q

The precompiler cannot compile ______ SQL statements.

39
Q

The executeQuery() method:

A

Both compiles and executes an SQL statement.

40
Q

In the Informix set type, the base type must be a group of character strings T/F