Ch. 2 Flashcards

1
Q

Which of the following would be an invalid column or table name? select all that apply
- P!nk
- 21PILOTS
- BrunoMar$
- Lady-Gaga

A
  • P!nk
  • 21PILOTS
  • Lady-Gaga
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following data type(s) is(are) supported by Oracle?
- NCLOB
- NUMBER
- CHAR
- STRING
- TIME ZONE(n) WITH TIMESTAMP

A
  • NCLOB
  • NUMBER
  • CHAR
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which two constraints are combined to implement a primary key?
- UNIQUE
- NOT NULL
- FOREIGN KEY
- CHECK

A
  • UNIQUE
  • NOT NULL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The difference between dropping a column from a table with DROP and setting the column to UNUSED is:

A

The UNUSED column and its data are retained within the table’s storage allocation and counts against the total limit on the number of columns that a table is allowed to have, but no longer appears within the table’s description as shown with a DESC or DESCRIBE

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

Which of the following is the recommended constraint for the SHIPS table having Primary key SHIP_ID?
- ship_id_PK
- ships_id_PK
- PRIMARY KEY(Ship_id)
- Ships_Ship_ID_PK

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

DDL statements when executed, will also cause a COMMIT to occur

A

True

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

Which of the following are true for ‘RR’ year designation?
- 68 means 1968
- 25 means 2025
- 50 can either mean 1950 or 2050
- 45 means 2045

A
  • 68 means 1968
  • 25 means 2025
  • 45 means 2045

Note: For years 0 - 49, it will refer to 2000 - 2049.
For 50 - 99, it will refer to 1950 - 1999.

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

The data type that would be used for a column that will be storing employee photographs for a large, multi-national company is:
- CLOB
- BLOB
- NCLOB
- GLOB

A

-BLOB

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

Which of the following are valid table names that may be used with the CREATE TABLE command? choose all that apply
- $Customers
- Order_lines
- “Boat Inventory”
- Retired#Emps
-Financial_Categories_No_longer_active

A
  • Order_lines
  • “Boat Inventory”
  • Retired#Emps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A collection of the database objects, such as tables, sequences, views, and indexes, that are owned by a single user account is called a(n) _____.
- Role
- database partition
- ERD
- schema

A

schema

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

What DDL command permits you to add, modify, or drop a column or constraint for an existing table?
- ADD
- DROP
- MODIFY
- ALTER

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

What component of SQL is used to build and manage the database objects and define the structure of the database?
- DML
- DLD
- the schema
- DDL

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

Oracle naming conventions

A
  • Must begin with a letter
  • Can be 1-30 characters long
  • Must contain only A-Z, a-z, 0-9, _, $, #
  • Must not duplicate name of another object owned by the same user
  • Must not be an oracle reserved word
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Quoted names are allowed (but not reccommended)

A

True
- Quoted names are case sensitive and you must use the quotes after

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

What is BLOB (Binary Large Object )?

A

binary data, such as an image or video

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

What is CLOB (Char Large Object )?

A

character data
- ASC11 code

17
Q

What is NCLOB?

A

CLOB for unicode

18
Q

What are two ways to create constraints for a table?

A
  1. at table creation time
  2. after the table is created, with an ALTER table command
19
Q

Constraint naming convention

A

Table_column_constraint_type

20
Q

What happens after you set a column as UNUSED?

A
  • The column and its data are still within the table’s storage and it is no longer available and can never be recovered, but it is not dropped
  • The column still counts against the total column limit (1000)
  • are not physically dropped, but act as if they were dropped
21
Q

What happens after you DROP a column?

A
  • The column may or may not contain data
  • The column cannot be referenced by a foreign key in another table
  • You cannot “un-drop” a column
  • All data currently stored in the column to be deleted, in each row of the table, will be permanently deleted
22
Q

Consider the following statement:

CREATE TABLE PORTS
(port_id NUMBER,
port_name VARCHAR2(20));

Which of the following modifications to the statement is the only valid way to declare that the port_name is required (not optional)?

  • port_name VARCHAR2(20) NOT NULL (port_name)
  • port_name VARCHAR2(20),
    CONSTRAINT ports_port_name_nn NOT NULL (port_name)
  • port_name VARCHAR2(20) NOT NULL
  • ALTER TABLE PORTS
    CONSTRAINT ports_port_name_nn NOT NULL (port_name);
A
  • port_name VARCHAR2(20) NOT NULL
23
Q

What would happen when the following statement is executed:

CREATE TABLE GGC_Student

( StudentID CHAR(6),

SName VarChar2(40),

gpa Number(5,4)

);

  • An error will occur because no primary key is specified
  • An error will occur because a table name cannot contain an underscore
  • The table will be created with StudentID as the Primary Key
  • The table will be created without a primary key
A
  • The table will be created without a primary key