Solved

(A)SQL*Plus Environment Variables Are Set to Default Values When SQL*Plus orderNo\underline{\text{{orderNo}}}

Question 16

Essay

(a)SQL*Plus environment variables are set to default values when SQL*Plus is started. State three ways by which users can change the default setting.
(b)Write SQL*Plus commands to do the following:
• List all SQL*Plus commands;
• Connect to the database 'OracleDB' with the user name 'CustomerOrders' and password 'customer';
• Use the COLUMN command to set the output format of the field 'StaffName' to 30 characters.
(c) Write SQL statements to do the following:
(1) List the name and granted roles of the current user;
(2) List name and type of all objects owned by the current user;
(3) List table name and the tablespace name to which the table is assigned of all tables owned by the current user;
(4) List the next value of the sequence Emp_Seq.
(d)Given the following schema of a database table:
Orders( orderNo\underline{\text{{orderNo}}} , dateDue, totalValue, status, custNo)
where: custNo is the number of the customer who placed the order.
Write a script with the necessary formatting commands (e.g. COLUMN, BREAK, TTITLE, etc.) and an SQL statement to create a report that lists each customer number, each order number he/she placed, the total value of each order, the sum of the total values of all the orders for each customer, and the grand total of all the orders placed by all customers under the following heading:
 (a)SQL*Plus environment variables are set to default values when SQL*Plus is started. State three ways by which users can change the default setting.  (b)Write SQL*Plus commands to do the following:  • List all SQL*Plus commands; • Connect to the database 'OracleDB' with the user name 'CustomerOrders' and password 'customer'; • Use the COLUMN command to set the output format of the field 'StaffName' to 30 characters. (c) Write SQL statements to do the following: (1) List the name and granted roles of the current user; (2) List name and type of all objects owned by the current user; (3) List table name and the tablespace name to which the table is assigned of all tables owned by the current user; (4) List the next value of the sequence Emp_Seq. (d)Given the following schema of a database table: Orders( \underline {\text{{orderNo}}} , dateDue, totalValue, status, custNo)  where: custNo is the number of the customer who placed the order. Write a script with the necessary formatting commands (e.g. COLUMN, BREAK, TTITLE, etc.) and an SQL statement to create a report that lists each customer number, each order number he/she placed, the total value of each order, the sum of the total values of all the orders for each customer, and the grand total of all the orders placed by all customers under the following heading:

Correct Answer:

verifed

Verified

(a) Users can change the default setting...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents