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 9MC
Which of the following commands removes all data from a table but leaves the table’s structure intact?
- a. ALTER TABLE secustomerorders DROP UNUSED COLUMNS;
- b. TRUNCATE TABLE secustomerorders;
- c. DELETE TABLE secustomerorders;
- d. DROP TABLE secustomerorders;
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
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);
The SAS table hold.work contains a numeric column named ID. Write an entire DATA step to create a table named hold.work2 that is a copy of hold.work but additionally contains a new character column named Name. Name should have the value "Food" when the existing numeric column ID is 50, and it should have the value "Ok" otherwise. [Note: Make sure the entire value is stored.]
Which of the following commands removes all data from a table but leaves the table’s structure intact? (refer to the tables in the JustLee Books databasea. ALTER TABLE secustomerorders DROP UNUSED COLUMNS;b. TRUNCATE TABLE secustomerorders;c. DELETE TABLE secustomerorders;d. DROP TABLE secustomerorders;
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
- Modify the Job_class column of the EMPLOYEES table so that it allows storing a maximum width of two characters.arrow_forwardWhich of the following statements is correct? A table can contain a maximum of only one column marked as unused. You can delete a table by removing all columns in the table. Using the SET UNUSED clause allows you to free up storage space used by a column. None of the above statements are correct.arrow_forwardWhen you issue the DELETE FROM tablename command without specifying a where condition, Select one: a. The last row will be deleted. b.All rows will be deleted. c.The first row will be deleted. d.No rows will be deleted.arrow_forward
- 8. Create a trigger for the Invoices table that automatically inserts the vendor name and address for a paid invoice into a table named ShippingLabels. The trigger should fire any time the PaymentTotal column of the Invoices table is updated. The structure of the ShippingLabels table is as follows: CREATE TABLE ShippingLabels (VendorName varchar(50), VendorAddress1 varchar(50), VendorAddress2 varchar(50), VendorCity VendorState VendorZipCode varchar(50), char(2), varchar(20)); Use this UPDATE statement to test the trigger: UPDATE Invoices SET PaymentTotal = 67.92, PaymentDate = '2020-02-23' WHERE InvoiceID = 100;arrow_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_forwardQuestion 8: Which statement is incorrect regarding tables? Answer: A. B. C. D. You can convert a worksheet list into a table. Since table data cannot be modified, the Re-create button stays active so you can easily start over. If the table range Excel proposes isn't correct, just change it before creating the table. Table formatting can be applied and changed after the table has been created.arrow_forward
- Which of the following is true? (refer to the tables in the JustLee Books database)a. If you truncate a table, you can’t 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 can’t 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, it’s always added as the last column of the table.arrow_forwardWhich 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));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
- To add new data to a table, which of the following commands is used? Select one: a.ALTER TABLE ADD. b.INSERT C.ADD d.CREATEarrow_forwardUsing a CREATE statement to create a table called s1, which is a duplicate of table STUDENT, then remove all the data from s1 (you need to write two statements for this question.)arrow_forwardCreate table “Cleaner” (cNo varchar2(5), cName varchar2(20), cSalary number(6,2), dNo varchar2(5)). Write a table level trigger which can tell how the restriction on ‘cSalary’ is violated. Whenever the value of ‘cSalary’ is beyond the valid range (0 – 5000), the trigger will generate an error message informing user whether it is greater than 5000 or a negative numberarrow_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