Week 9 Flashcards

Creating/Modifying Tables

1
Q

What language is used to create and modify tables?

A. data design language (ddl)
B. data information language (dil)
C. data definition language (ddl)
D. simple query language (sql)

A

C. data definition language (ddl)

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

A variable length character data. the (n) is the maximum length.

A. VARCHAR2(n)
B. CHAR(n)
C.CHAR2(n)
D. NUMBER(n)

A

A. VARCHAR2(n)

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

A fixed length character folumn. The (n) is the column length.

A. VARCHAR2(n)
B. CHAR(n)
C.CHAR2(n)
D. NUMBER(n)

A

B. CHAR(n)

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

The p in NUMBER(p,s) stands for what? Select all that apply.

A. Precision
B. Percent
C. total number of digits
D. digits only to the left of the decimal

A

A. Precision

C. total number of digits

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

The type of data Oracle12C is expected to store in a column is called what?

A

datatype

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

How many columns can a table contain?

A. 100
B. 1000
C. 10000
D. none of the above

A

B. 1000

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

True/False: When creating a table, columns should be enclosed in parenthesis.

A

True

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

When creating a table, the columns must have what after the name to define them?

A. datatype
B. datafield
C. datadefinition
D. None of the above

A

A. datatype

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

What command do you use to add rows after a table is created?

A. ADD
B. INSERT
C. CREATE RECORD

A

B. INSERT

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

To view the stRucture of a table, what command do you use?

A. SHOW SCHEMA
B. DETAILS
C. DESCRIBE

A

C. DESCRIBE

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

Choose the correct syntax for creating a table.

A. CREATE TABLE test
(ID CHAR(4)
name VARCHAR2(15)
bday DATE DEFAULT SYSDATE);

B. CREATE TABLE test
(ID CHAR(4),
name VARCHAR2(15),
bday DATE DEFAULT SYSDATE)

C. CREATE TABLE test
(ID CHAR(4),
name VARCHAR2(15),
bday DATE DEFAULT SYSDATE;

D. CREATE TABLE test
(ID CHAR(4),
name VARCHAR2(15),
bday DATE DEFAULT SYSDATE);

A

D. CREATE TABLE test
(ID CHAR(4),
name VARCHAR2(15),
bday DATE DEFAULT SYSDATE);

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

The _____ data dictionary object maintains information on all your tables. Use it to show all the tables in your schema.

A. TABLES_DATA
B. USER_TABLES
C. USER_DATA
D. TABLES_USER

A

B. USER_TABLES

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

The ___ TABLE command is used to modify tables.

A. ALTER
B. CHANGE
C. MODIFY

A

A. ALTER

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

Using the ALTER TABLE ADD does what?

A

Adds a column

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

To change the column definition after it’s already been created what syntax do you use?

A. ALTER TABLE CHANGE
B. ALTER TABLE FIX
C. ALTER TABLE MODIFY

A

C. ALTER TABLE MODIFY

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

Which of the following are true of modifying existing columns?

A. it must be as wide as the data fields it already contains
B. Changes to a NUMBER column that already contains data will erase the data
C. You cannot decrease the precision or scale of a NUMBER column if it already contains data

A

A. it must be as wide as the data fields it already contains

C. You cannot decrease the precision or scale of a NUMBER column if it already contains data

17
Q

What command is used in creating a table or columns to set the date to the current date without the user inputting data?

A

SYSDATE

18
Q

To create a table from an existing table what command do you use?

A. CREATE FROM
B. CREATE TABLE…AS
C. NEW TABLE…AS
D. NEW TABLE FROM

A

B. CREATE TABLE…AS

19
Q

Use the ALTER TABLE _____ COLUMN to delete an existing column from a table.

A. DROP
B. DELETE
C. REMOVE
D. ERASE

A

A. DROP

20
Q

You cannot remove what two types of columns from a table?

A

Primary key column

last column in the table

21
Q

The SET UNUSED command is used to what? It makes the data in the column unavailable.

A

Marks it for deletion at another time.
Useful to use in production environments if you want the data to be ‘gone’ but you do not want the server to process it until a time there is less load on the server.

22
Q

True/False: You can query a table based on it’s old name if you used the RENAME command.

A

False

23
Q

If you want to remove all the records (rows) in a table, but keep the columns, what command would you use?

A. REMOVE ALL
B. DELETE * ROWS
C. TRUNCATE TABLE
D. TRUNCATE RECORDS

A

C. TRUNCATE TABLE

24
Q

The DROP TABLE command does what?

A

Deletes an entire table, structure and data.

25
Q

True/False: After using the DROP TABLE command, it can be recovered from a recycle bin.

A

True

26
Q

What command is used to restore a table after it was deleted?

A. FLASHBACK TABLE
B. RESTORE TABLE
C. RECREATE TABLE

A

A. FLASHBACK TABLE

27
Q

Use the ____ TABLE to remove it from the recycle bin.

A. DELETE
B. REMOVE
C. ERASE
D. PURGE

A

D. PURGE

28
Q

What constraint type cannot be created at the table level?

A

NOT NULL

29
Q

True/False: If a data value violates a constraint, the entire row is rejected

A

True

30
Q

True/False: You can delete a value in a parent table if it is referenced by a child table? (foreign keys)

A

No

If a value is referenced in another table, it cannot be deleted.

31
Q

What command is used to automatically set a parent row value to delete if the foreign key value is deleted in a child table?

A. ON DELETE REPLICATE
B. ON DELETE CASCADE
C. ON DELETE PARENT
D. ON DELETE PURGE

A

A. ON DELETE REPLICATE

32
Q

The _____ constraint is used to verify another condition is true before accepting input.

A. VERIFY
B. CHECK
C. UNIQUE

A

B. CHECK

33
Q

What command is used to display constraint listing for a specific table?

A

USER_CONSTRAINTS

34
Q

Use the ____ command to stop using a constraint.

A

DISABLE