Which of the following queries contains a non-equality
join?
a. SELECT title, authorid
FROM books, bookauthor
WHERE books.isbn = bookauthor.isbn
AND retail > 20;
b. SELECT title, name
FROM books JOIN publisher
USING (pubid);
c. SELECT title, gift
FROM books, promotion
WHERE retail >= minretail
AND retail <= maxretail;
d. none of the above
c. SELECT title, gift
FROM books, promotion
WHERE retail >= minretail
AND retail <= maxretail;
Explanation:
Non Equi Joins is a joins which contains an operator other than ‘=’ in the join condition
in A option contains = in where clause and B options contains join, so both are omitted as non-equi joins.
Which of the following queries contains a non-equality join? a. SELECT title, authorid FROM books, bookauthor...
Do these codes look right for the following 5 statements. This is using Oracle SQL: Write a query that displays the title, ISBN, and wholesale cost of books whose wholesale cost is more than the average of all books. Format the retail price with dollars and cents. Write a query that displays the title and publication date of the oldest book in the BOOKS table. Format the date with the complete name of the month and a comma after the...
Please help me on the SQL
queries, thank you so much.
Write a query to display the
title and publisher as well as the publisher contact for each book
using JOIN...USING clause.
Write a query to show the
first and last names of customers who have ordered cooking books.
Use the WHERE clause to join the tables.
Write a query to show the
title, cost and ISBN of each book in the books table. If the book
has been ordered,...
Oracle 12c Based upon the contents of the BOOKS table, which of the following SQL statements will display the retail price for two copies of each book currently in inventory?" SELECT * FROM books; SELECT title, retail+retail FROM books; SELECT title, retail^2 FROM books; none of the above
create table books (title text primary key,pubdate text,publisher text,publishercity text,scope text); create table publishers (publisherName text,founded date,founderName text[],headquarters text); insert into books values ('the gremlins', 1943, 'random house', 'new york', 'children'), ('sometime never: a fable for supermen', 1948, 'charles scribner''s sons', 'new york', 'adult'), ('james and the giant peach', 1961, 'alfred a. knopf', 'new york', 'children'), ('charlie and the chocolate factory', 1964, 'alfred a. knopf', 'new york', 'children') insert into publishers(publisherName, founded, founderName, headquarters) values ('random house', 'Jan 1, 1927',...
Write the following SQL statements in Microsoft Access by using the Books database from Week 2 Assignment 2. Once complete, copy and paste the SQL statements in a Microsoft Word document: Write SQL statements: To update the publisher name from READ WITH US to READ FOR US To verify the updated name field for the publisher with ID 6 To make the following updates to the Publisher table (be careful with WHERE): Make Contact="John Travolta" for publisher with ID number...
Given the following schema books(id,title,pub_year,pages,isbn), what is the SQL statement needed to find all the books published in the year 2002? a)SELECT pub_year = 2002 in books; b) SELECT ALL in books WHERE pub_year = 2002; C) SELECT * FROM books WHERE (pub_year,2002); D) SELECT * FROM books WHERE pub_year = 2002;
In using a database created from this model, which of the
following SQL queries would give us a list of customers who have
daily deposit transactions (deposit is a
transaction type) totaling $10,000 or more across all of
their accounts (i.e., this is a total across all accounts of a
customer, not per account). Include in this list the Customer ID
and name, and the dates and their respective daily total.
SELECT c.cust_id, c.cust_name, DATE(t.tran_date), SUM(t.tran_amount) AS daily_total
FROM Customers...
Which of the following queries on table STUDENT will return three values as a result? STUDENT Observe the table STUDENT: STUDENT StudentID SSN Name Class D111 111-11-1111 Connor Freshman D222 222-22-2222 Trevor Freshman D333 333-33-3333 Connor Sophomore D444 444-44-4444 Parker Sophomore D555 555-55-5555 Connor Sophomore Select one: a. SELECT name FROM student; b. SELECT class FROM student; c. SELECT DISTINCT name FROM student; d. SELECT name FROM student WHERE class != 'Sophomore';
oracle only
database:
DROP TABLE ORDERITEMS;
DROP TABLE Orders;
DROP TABLE BOOKAUTHOR;
DROP TABLE BOOKS;
DROP TABLE PROMOTION;
DROP TABLE AUTHOR;
DROP TABLE CUSTOMERS;
DROP TABLE PUBLISHER;
CREATE TABLE Customers
( Customer# NUMBER(4),
LastName VARCHAR2(10) NOT NULL,
FirstName VARCHAR2(10) NOT NULL,
Email VARCHAR(40),
Address VARCHAR2(20),
City VARCHAR2(12),
State VARCHAR2(2),
Zip VARCHAR2(5),
Referred NUMBER(4),
Region CHAR(2),
CONSTRAINT customers_customer#_pk PRIMARY KEY(customer#)
);
INSERT INTO CUSTOMERS
VALUES (1001, 'MORALES', 'BONITA', 'bomor@gmail.com', 'P.O.
BOX 651', 'EASTPOINT', 'FL', '32328', NULL, 'SE');
INSERT INTO CUSTOMERS
VALUES...
Rewrite the following SQL query using a sub query: SELECT Shares.shareName, Shares.code FROM Nations INNER JOIN Shares ON Nations.ID = Shares.nationID WHERE Nations.nationName = 'Australia';