Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Which of the following is a valid SQL statement?a. SELECT * WHERE amid = ‘J100’ FOR UPDATE;b. INSERT INTO homeworkl0 VALUES (SELECT * FROM acctmanager);c. DELETE amid FROM acctmanager;d. rollback;e. all of the above
Which of the following is not a valid SQL statement? (refer to the tables in the JustLee Books database.)a. SELECT MIN(pubdate)FROM booksGROUP BY categoryHAVING pubid = 4;b. SELECT MIN(pubdate)FROM booksWHERE category = 'COOKING';c. SELECT COUNT(*)FROM ordersWHERE customer# = 1005;d. SELECT MAX(COUNT(customer#))FROM ordersGROUP BY customer#;
Which of the following is a valid SQL statement? (refer to the tables in the JustLee Books database.)a. SELECT customer#, order#, MAX(shipdate-orderdate)FROM ordersGROUP BY customer#WHERE customer# = 1001;b. SELECT customer#, COUNT(order#)FROM ordersGROUP BY customer#;c. SELECT customer#, COUNT(order#)FROM ordersGROUP BY COUNT(order#);d. SELECT customer#, COUNT(order#)FROM ordersGROUP BY order#;
Chapter 5 Solutions
Oracle 12c: SQL
Ch. 5 - Which command should you use to copy data from one...Ch. 5 - Which command can you use to change the existing...Ch. 5 - Which of the following is a correct statement? a....Ch. 5 - Which of the following is a valid SQL...Ch. 5 - Which of the following statements deletes all rows...Ch. 5 - What is the maximum number of records that can be...Ch. 5 - Add a new row in the ORDERS table with the...Ch. 5 - Prob. 2HOACh. 5 - Save the changes permanently to the database.
Ch. 5 - Add a new row in the ORDERS table with the...
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 SQL statements is invalid and returns an error message? ALTER TABLE books ADD CONSTRAINT books_pubid_uk UNIQUE (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_pk PRIMARY KEY (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_nn NOT NULL (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_fk FOREIGN KEY (pubid) REFERENCES publisher (pubid); All of the above statements are invalid.arrow_forwardWhich of the following is a correct statement? a. A commit is issued implicitly when a user exits SQL Developer or SQLPlus. b. A commit is issued implicitly when a DDL command is executed. c. A commit is issued automatically when a DML command is executed. d. All of the above are correct. e. Both a and b are correct. f. Both a and c are correct.arrow_forwardThe following statements are executed:create sequence my_seg; select my_seg.nextval from dual;select my_seg.nextval from dual;rollback; select my_seg.nextval from dual; What value will return when the last SQL statement is executed? Select one: a. 2b. 1c. 3d. 0e. NULLarrow_forward
- Which of the following is a valid SQL statement?a. ALTER TABLE secustomersspent ADD DATE lastorder;b. ALTER TABLE secustomerorders DROP retail;c. CREATE TABLE newtable AS (SELECT * FROM customers);d. ALTER TABLE drop column *;arrow_forwardExamine the EMPLOYEES table and the given SQL statement: EID Name Dept Salary 1001 Aminah IT 600 1002 Zainab Admin 400 1003 Tafal IT SELECT Name, Dept, Salary FROM employees WHERE name LIKE'_a%' AND salary IS NULL; Which of the following will be the output after executing the statément? a. Name Dept Salary Tafal IT b. Name Dept Salary Aminah IT 600 Zainab Admin 400 Name Dept Salary Zainab Admin 400 Name Dept Salary Aminah IT 600 DELLarrow_forwardTHIS MODULE IS ABOUT SUBQUERIES, SO YOU MUST USE SUBQUERIES INSTEAD OF TABLE JOINS (a) From which two fields in which table can you calculate the enrollment of a section?(b) From which table can you get both course and section numbers?(c) Which field in table SECTION uniquely identifies a section, section id or section no?(d) Write a SQL statement to show sections and their enrollment.(e) Write a SQL statement to show sections with enrollment greater than five. Display both course andsection numbersarrow_forward
- SELECT customer.LastName, COUNT(Orders.OrderID) As NumberOfOrdersFROM orders, customersWHERE customer.customerID = Orders.CustomerIDGROUP BY LastNameHAVING COUNT(Orders.OrderID) > 18;a) What is the purpose of the COUNT function in this SQL statement? 2b) What is the purpose of the GROUP BY command in this SQL statement? 3c) What is the purpose of the HAVING command in this SQL statement? 3d) How would you modify this SQL query so that it shows the orders for customers 2called ‘Smith’ regardless of how many orders have been made?arrow_forwardComplete the SQL statement to generate the Result table. The column names in the SELECT clause must match the Result table exactly. Order Part • OrderCode PartNumber R58 492 Quantity 4 • PartNumber PartName Price 662 Z23 492 3 492 Wingding Buzzer 11 0.4 A36 662 1 R61 827 1 SELECT /* Type your code here */ FROM Order, Part WHERE /* Type your code here */ Result OrderCode PartName Order.PartNumber Buzzer 492 R58 Z23 Buzzer 492 A36 Wingding 662arrow_forward5- Examine the STUDENTS table and the given SQL statement: EID Name Dept Salary 1001 Aminah IT 600 1002 Zainab Admin 400 1003 Tafal IT SELECT Name, Dept, SalaryFROM studentsWHERE name LIKE ‘_a%’ AND salary IS NOT NULL; Which of the following will be the output after executing the statement? a. Name Dept Salary Zainab Admin 400 b. Name Dept Salary Tafal IT c. Name Dept Salary Aminah IT 600 d. Name Dept Salary Zainab Admin 400 Tafal ITarrow_forward
- Which of the following SQL statements determines how many total customers were referred by other customers? (refer to the tables in the JustLee Books database.)a. SELECT customer#, SUM(referred)FROM customersGROUP BY customer#;b. SELECT COUNT(referred)FROM customers;c. SELECT COUNT(*)FROM customers;d. SELECT COUNT(*)FROM customersWHERE referred IS NULL;arrow_forwardi. What Is A Savepoint Command? ii. What Are Pseudo-columns? iii. How Can You Use Pseudo Columns In Procedural Statements? iv. How Can You Check If An Update Statement In Pl/sql Is Successfully Executed?arrow_forwardWrite the following SQL Statements: Write a SELECT statement that returns one row for each customer that has orders with these columns: The email_address from the Customers table A count of the number of orders The total amount for each order (Hint: First, subtract the discount amount from the price. Then, multiply by the quantity.) Return only those rows where the customer has more than 1 order. Sort the result set in descending sequence by the sum of the line item amounts. Write a SELECT statement that answers this question: What is the total amount ordered for each product? Return these columns: The product name from the Products table The total amount for each product in the Order_Items (Hint: You can calculate the total amount by subtracting the discount amount from the item price and then multiplying it by the quantity) Use the ROLLUP operator to include a row that gives the grand total. Write a SELECT statement that answers this question: Which customers have ordered more…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
How to Design DB Tables for any Application? (The Basics); Author: Studytonight;https://www.youtube.com/watch?v=XUdNVaSikqY;License: Standard YouTube License, CC-BY
Create a Table (Introduction to Oracle SQL); Author: Database Star;https://www.youtube.com/watch?v=BiV1IrzB1sY;License: Standard Youtube License