Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3, Problem 16MC
Which of the following commands creates a new table containing two columns?
- a. CREATE TABLE newname (coll DATE, col2 VARCHAR2);
- b. CREATE TABLE newname AS (SELECT title, retail, cost FROM books);
- c. CREATE TABLE newname (col1, co12);
- d. CREATE TABLE newname (col1 DATE DEFAULT SYSDATE, co12 VARCHAR2 (1));
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Which of the following commands creates a new table containing two columns?a. CREATE TABLE newname (coll DATE, col2 VARCHAR2);b. CREATE TABLE newname AS (SELECT title, retail, cost FROM books);c. CREATE TABLEnewname (coll, col2);d. CREATE TABLE newname (coll DATE DEFAULT SYSDATE, col2 VARCHAR2 (1));
The following table has been created:
CREATE TABLE student table (
stud id NUMBER (6),
last_name VARCHAR2 (20),
first name VARCHAR2 (20),
lunch num NUMBER (4) ) ;
Which one of the following INSERT statements will fail?
O INSERT INTO student table VALUES (143354, 'Roberts', 'Cameron', 6543);
O INSERT INTO student_table (stud_id, last_name, lunch_num) VALUES (143354, Roberts, 6543, 'Cameron');
O INSERT INTO student_table (stud_id, last_name, first_name, lunch_num) VALUES (143354, 'Roberts', 'Cameron', 6543);
O INSERT INTO student_table (stud_id, lunch_num, first_name, last_name) VALUES (143352, 6543, 'Cameron', 'Roberts');
Which of the following commands changes a table’s name from OLDNAME to NEWNAME?a. RENAME oldname TO newname;b. RENAME table FROM oldname TO newname;c. ALTER TABLE oldname MODIFY TO newname;d. CREATE TABLE newname (SELECT * FROM oldname);
Chapter 3 Solutions
Oracle 12c: SQL
Ch. 3 - Which command is used to create a table based on...Ch. 3 - Prob. 2RQCh. 3 - What guidelines should you follow when naming...Ch. 3 - What is the difference between dropping a column...Ch. 3 - Prob. 5RQCh. 3 - What happens to the existing rows of a table if...Ch. 3 - Explain the difference between truncating a table...Ch. 3 - Prob. 8RQCh. 3 - What happens if you try to decrease the scale or...Ch. 3 - Are a table and the data contained in the table...
Ch. 3 - Which of the following is a correct statement?
You...Ch. 3 - Prob. 2MCCh. 3 - Which of the following is not a correct...Ch. 3 - Which of the following is not a valid SQL...Ch. 3 - Which of the following is true? a. If you truncate...Ch. 3 - Which of the following commands creates a new...Ch. 3 - Which of the following commands drops any columns...Ch. 3 - Which of the following statements is correct?
A...Ch. 3 - Which of the following commands removes all data...Ch. 3 - Which of the following commands changes a table’s...Ch. 3 - Prob. 11MCCh. 3 - Which of the following is not a valid...Ch. 3 - Which of the following characters can be used in a...Ch. 3 - Which of the following is true?
All data in a...Ch. 3 - Prob. 15MCCh. 3 - Which of the following commands creates a new...Ch. 3 - Which of the following is a valid table name? a....Ch. 3 - Prob. 18MCCh. 3 - Which object in the data dictionary enables you to...Ch. 3 - Prob. 20MCCh. 3 - Create a new table containing the category code...Ch. 3 - Create a new table containing these four columns:...Ch. 3 - Add two columns to the EMPLOYEES table. One...Ch. 3 - Modify the Job_class column of the EMPLOYEES table...Ch. 3 - Prob. 5HOACh. 3 - Rename the EMPLOYEES table as JL_EMPS.
Ch. 3 - Create a new table containing these four columns...Ch. 3 - Prob. 8HOACh. 3 - Truncate the BOOK_PRICING table, and then verify...Ch. 3 - Delete the BOOK_PRICING table permanently so that...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Which of the following commands removes all data from a table but leaves the tables structure intact? a. ALTER TABLE secustomerorders DROP UNUSED COLUMNS; b. TRUNCATE TABLE secustomerorders; c. DELETE TABLE secustomerorders; d. DROP TABLE secustomerorders;arrow_forwardWhich of the following commands drops any columns marked as unused from the SECUSTOMERORDERS table? DROP COLUMN FROM secustomerorders WHERE column_status = UNUSED ALTER TABLE secustomerorders DROP UNUSED COLUMNS; ALTER TABLE secustomerorders DROP (unused); DROP UNUSED COLUMNS;arrow_forwardWhich of the following is a correct statement? You can restore the data deleted with the DROP COLUMN clause, but not the data deleted with the SET UNUSED clause. You can’t create empty tables—all tables must contain at least three rows of data. A table can contain a maximum of 1000 columns. The maximum length of a table name is 265 characters.arrow_forward
- Which of the following symbols is used in a SELECT clause to display all columns from a table? / & * "arrow_forwardWhich object in the data dictionary enables you to verify DEFAULT column settings? DEFAULT_COLUMNS DEF_TAB_COLUMNS USER_TAB_COLUMNS None of the abovearrow_forwardModify the Job_class column of the EMPLOYEES table so that it allows storing a maximum width of two characters.arrow_forward
- Which of the following characters can be used in a table name? a. b. ( c. % d. !arrow_forwardWhich of the following is true? a. If you truncate a table, you cant add new data to the table. b. If you change the default value of an existing column, all existing rows containing a NULL value in the same column are set to the new DEFAULT value. c. If you delete a column from a table, you cant add a column to the table with the same name as the previously deleted column. d. If you add a column to an existing table, its always added as the last column of the table.arrow_forwardDatabase Q1: Which one of the following INSERT statements will successfully insert a single row? The following table has been created: CREATE TABLE student_table ( stud_id NUMBER (6), last_name VARCHAR2 (20), first_name VARCHAR2 (20), lunch_num NUMBER (4) ; a) INSERT VALUES INTO student_table (143354, ‘Roberts’, ‘Cameron’, 6543); b) INSERT INTO student_table COLMUNS (stud_id, last_name, lunch_num) VALUES (143352, ‘Roberts’, 5543, ‘Cameron’); c) INSERT TO student_table (stud_id, lunch_num, first_name, last_name) VALUES (143352, 6543, ‘Cameron’, ‘Roberts’); d) INSERT INTO student_table VALUES (143354, ‘Roberts’, ‘Cameron’, 6543); Q2: What does the following SQL statement display: SELECT EMP_ID, LAST_NAME, SALARY FROM EMPLOYEES WHERE SALARY > (SELECT MIN (E. SALARY) FROM EMPLOYEES E) ORDER BY SALARY DESC; a) Employees information who earn less money than the maximum salary b) Employees information who earn more money than the highest employee salary c) Employees information who earn…arrow_forward
- Question Workspace Which of the following statements is valid? a. DROP table_name; b. DELETE TABLE table_name; c. UPDATE TABLE table_name SET col1 = new_value; d. ALTER TABLE table_name MODIFY col1 CHAR(10); e. All of the above. f. None of the above. Icon Keyarrow_forwardQ1. Write a SELECT statement that returns these columns from the Invoices table: ⚫ The invoice_total column • A column that uses the ROUND function to return the invoice_total column with 1 decimal digit • A column that uses the ROUND function to return the invoice_total column with no decimal digits invoice_total one_digit 3813.33 zero_digits 3813.3 3813arrow_forwardSuppose you want to add a new column to the CUSTOMERS table with the following details: CUSTOMERS Column Name Data Type Address Varchar2(20) Enter the correct command (syntax) in the text box provided below ]CUSTOMERS[ Address Varchar2(20)); ALTER Varchar2(20); ADD ( TABLE ADD COLUMN ( ADDarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY