Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
error_outline
This textbook solution is under construction.
Students have asked these similar questions
Which one of the following SQL statements produces the same result asselect time_of_day_hour, time_of_day_minute, time_of_day_secondfrom time_of_daywhere time_of_day_hour BETWEEN 2 and 8;
Question 1 options:
1)
select time_of_day_hour, time_of_day_minute, time_of_day_secondfrom time_of_daywhere time_of_day_hour >= 2 and time_of_day_hour <= 8;
2)
select time_of_day_hour, time_of_day_minute, time_of_day_secondfrom time_of_daywhere time_of_day_hour > 2 and time_of_day_hour < 8;
3)
select time_of_day_hour, time_of_day_minute, time_of_day_secondfrom time_of_daywhere (2 <= time_of_day_hour <= 8);
4)
select time_of_day_hour, time_of_day_minute, time_of_day_secondfrom time_of_daywhere time_of_day_hour > 2 and <8;
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#;
Which of the following SQL statements is invalid and returns an error message? ( refer to the tables in the JustLee Books database).
a. ALTER TABLE books ADD CONSTRAINT books_pubid_uk UNIQUE (pubid); b. ALTER TABLE books ADD CONSTRAINT books_pubid_pk PRIMARY KEY (pubid); c. ALTER TABLE books ADD CONSTRAINT books_pubid_nn NOT NULL (pubid); d. ALTER TABLE books ADD CONSTRAINT books_pubid_fk FOREIGN KEY (pubid) REFERENCES publisher (pubid); e. All of the above statements are invalid
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 SELECT statements displays a list of customer names from the CUSTOMERS table? SELECT customer names FROM customers; SELECT “Names” FROM customers; SELECT firstname, lastname FROM customers; SELECT firstname, lastname, FROM customers; SELECT firstname, lastname, “Customer Names” FROM customers;arrow_forwardGiven the following SQL statement, which statement is most accurate?SELECT customer# FROM customersJOIN orders USING(customer#)WHERE shipdate-orderdate IN(SELECT MAX(shipdate-orderdate) FROM ordersWHERE shipdate IS NULL);a. The SELECT statement fails and returns an Oracle error message.b. The outer query displays no rows in its results because the subquery passes a NULLvalue to the outer query.c. The customer number is displayed for customers whose orders haven’t yet shipped.d. The customer numbers of all customers who haven’t placed an order are displayedarrow_forward
- SELECT MAX(datediff(minute,start_time,end_time)) as "Longest_ride", MIN(datediff(minute,start_time,end_time)) as "shortest_ride" from RIDE LIMIT 0, 1000 Error Code: 1582. Incorrect parameter count in the call to native function 'datediff' 0.00034 sec How do I solve this SQL errorarrow_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_forwardCreate a function name BALANCE that returns the status of outstanding amount for each customer. Use the following criteria for your function: Outstanding_amt less than 5000 , returns ‘SMALL AMOUNT’ Outstanding_amt between 5000 and 10000 , returns ‘AVERAGE AMOUNT’ Outstanding_amt greater than 10000 , returns ‘LARGE AMOUNT’ Use function BALANCE in your SQL statements that display the cust_code, cust_name, Outstanding_amt and function BALANCE.arrow_forward
- Which of the following SQL statements displays a customer’s name in all uppercase characters? (refer to the tables in the JustLee Books database.)a. SELECT UPPER('firstname', 'lastname')FROM customers;b. SELECT UPPER(firstname, lastname)FROM customers;c. SELECT UPPER(lastname, ',' firstname)FROM customers;d. none of the abovearrow_forwardIn SQL Server, specify the differences between the two character data types as follows: NVARCHAR VARCHARarrow_forwardWhich restaurant id had the highest number of orders placed in June 2021? Write SQL code, The columns are Date (yyyy-mm-dd), CustomerId,OrderiD and restaurant ID. The table name is dataarrow_forward
- Which of the following statements about the SELECT operation in SQL are true? [Select all that apply] a. A WHERE clause is always required within a SELECT statement. b. The SELECT clause is the first one evaluated in any SQL query. c. By default, the ORDER BY clause sorts tuples in descending order. d. A SELECT query may contain other SQL sub-queries except for another SELECT query. e. The HAVING clause specifies a condition for selecting grouped tuples from the GROUP BY clause.arrow_forwardWhich 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_forward
arrow_back_ios
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