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 4MC
Which of the following is not a valid SQL statement?
- a. CREATE TABLE anothernewtable (newtableid VARCHAR2 (2));
- b. CREATE TABLE anothernewtable (date, anotherdate)
AS (SELECT orderdate, shipdate FROM orders);
- c. CREATE TABLE anothernewtable (firstdate, seconddate)
AS (SELECT orderdate, shipdate FROM orders);
- d. All of the above are valid statements.
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 not a valid SQL statement?a. CREATE TABLE anothernewtable (newtableid VARCHAR2(2));b. CREATE TABLE anothernewtable (date, anotherdate) AS (SELECT orderdate, shipdate FROM orders);c. CREATE TABLE anothernewtable (firstdate, seconddate) AS (SELECT orderdate, shipdate FROM orders);d. All of the above are valid statements.
Which of the following SQL statements is valid?
a. INSERT INTO table_name (val1, val2);
b. ALTER COLUMN column_name SET PRIMARY KEY;
c. INSERT INTO table_name1 SELECT col1, col2 FROM table_name2;
d. SLTER TABLE table_name SET col1 PRIMARY KEY;
e. All of the above.
f. None of the above.
Which of the following operators is considered a single-row operator? (refer to the tables in the JustLee Books database.)a. INb. ALLc. <>d. <>ALL
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 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_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_forward
- Which of the following statements retrieves data from the Sales table and stores it in the CompanyDataSet? Me.CompanyDataSet.Fill(Me.Sales) Me.SalesBindingSource.Fill(Me.CompanyDataSet) Me.SalesBindingNavigator.Fill(Me.CompanyDataSet.Sales) Me.SalesTableAdapter.Fill(Me.CompanyDataSet.Sales)arrow_forwardWhich 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#;arrow_forwardWhich 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_forward
- Fill in the blank to complete the CREATE TABLE command below so that the type for customerzip would be fixed length 5-character string. CREATE TABLE customer ( customerid CHAR(7) NOT NULL, customername VARCHAR(15) NOT NULL, customerzip _______ NOT NULL, PRIMARY KEY (customerid) );arrow_forwardWhich of the following statements retrieves data from the Sales table and stores it in the CompanyDataSet? a. Me.CompanyDataSet.Fill(Me.Sales) b. Me.SalesBindingSource.Fill(Me.CompanyDataSet) c. Me.SalesBindingNavigator.Fill(Me.CompanyDataSet.Sales) d. Me.SalesTableAdapter.Fill(Me.CompanyDataSet.Sales)arrow_forwardWhich 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 invalidarrow_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_forward<?php session_start(); include "db_conn.php"; if (isset($_POST['uname']) && isset($_POST['password'])) { function validate($data){ $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } $uname = validate($_POST['user_name']); $pass = validate($_POST['password']); if (empty($uname)) { header("Location: index.php?error=User Name is required"); exit(); }else if(empty($pass)){ header("Location: index.php?error=Password is required"); exit(); }else{ $sql = "SELECT * FROM users WHERE user_name='$uname' AND password='$pass'"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) === 1) { $row = mysqli_fetch_assoc($result); if ($row['user_name'] === $uname && $row['password'] === $pass) { echo "Logged in!"; $_SESSION['user_name'] = $row['user_name'];…arrow_forwardWhich of the following SQL statements produces “Hello World” as the output? (refer to the tables in the JustLee Books database.)a. SELECT "Hello World" FROM dual;b. SELECT INITCAP('HELLO WORLD') FROM dual;c. SELECT LOWER('HELLO WORLD') FROM dual;d. both a and be. none of the abovearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY