Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Textbook Question
thumb_up100%
Chapter 1, Problem 1HOA
Which tables and fields would you access to determine which book titles have been purchased by a customer and when the order shipped?
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
What’s the purpose of a column qualifier? When are you required to use one?
Use the following table to answer the questions below:
Table name: Customers
Column Name
Role
Data Type
Length
Constraint
customerID
stores the ID of a customer
Char
5
Primary key
custFName
stores the first name of a customer
Varchar2
35
Cannot be null
custLName
Stores the last name of a customer
Varchar2
35
Cannot be null
custGender
Store the gender of a customer
Char
1
It should be ‘M’ or ‘F’
custDOB
Stores the date of birth of a customer
Date
custIncome
Store the income of a customer
Number
4
Write in SQL a command that creates the table Customers according to the above description (2 marks).
Write in SQL a statement that adds a new column named accountID of type Char(8). This column should be defined as a foreign key that relates the table Customers to the table Account (1.5 marks).
Write in SQL a command that deletes the customers whose date of birth is after 22-Dec-1990 (1.5 Marks).…
Use the following table to answer the question below:
Table name: Customers
Column Name
Role
Data Type
Length
Constraint
customerID
stores the ID of a customer
Char
5
Primary key
custFName
stores the first name of a customer
Varchar2
35
Cannot be null
custLName
Stores the last name of a customer
Varchar2
35
Cannot be null
custGender
Store the gender of a customer
Char
1
It should be ‘M’ or ‘F’
custDOB
Stores the date of birth of a customer
Date
custIncome
Store the income of a customer
Number
4
Write a SQL query that displays the number of customers who born on the 16th day of a month .
Write in SQL a query that displays the ids of the customers who have the highest income .
Create a view named ‘customerDetails’ to hold all the details of customers whose first names start with ‘S’ and their incomes are between 500 and 1000 Omani Rials .
Chapter 1 Solutions
Oracle 12c: SQL
Ch. 1 - Prob. 1RQCh. 1 - Prob. 2RQCh. 1 - Prob. 3RQCh. 1 - Prob. 4RQCh. 1 - Discuss the problems that can be caused by data...Ch. 1 - Explain the role of a primary key.Ch. 1 - Prob. 7RQCh. 1 - Prob. 8RQCh. 1 - What type of relationship can’t be stored in a...Ch. 1 - Identify at least three reasons an organization...
Ch. 1 - Prob. 1MCCh. 1 - Prob. 2MCCh. 1 - Prob. 3MCCh. 1 - Prob. 4MCCh. 1 - Prob. 5MCCh. 1 - Prob. 6MCCh. 1 - Prob. 7MCCh. 1 - Which of the following has no partial or...Ch. 1 - Prob. 9MCCh. 1 - Which of the following has no partial dependencies...Ch. 1 - Which of the following has no repeating groups but...Ch. 1 - Prob. 12MCCh. 1 - Prob. 13MCCh. 1 - A unique identifier for a data row that consists...Ch. 1 - Which of the following symbols represents an...Ch. 1 - Prob. 16MCCh. 1 - Which of the following represents a field in a...Ch. 1 - Which of the following defines a relationship in...Ch. 1 - When part of the data in a table depends on a...Ch. 1 - Which of the following is used to join data...Ch. 1 - Which tables and fields would you access to...Ch. 1 - Prob. 2HOACh. 1 - Prob. 3HOACh. 1 - Prob. 4HOACh. 1 - Access path A database table is composed of...Ch. 1 - Prob. 6HOACh. 1 - Prob. 7HOACh. 1 - Prob. 8HOACh. 1 - Prob. 9HOACh. 1 - Prob. 10HOA
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
- How do you indicate that a column alias should be used?arrow_forwardA query may use any one of six LINQ operators.arrow_forward9. Find the total amount of tax paid by resident of NJ Hint: The tax cost stored in tax_amount column in the orders table The state name stored in state column in the addresses tablearrow_forward
- An "Orders" table has 30 columns, and the report only needs the order total by date. Which transformation should you perform?arrow_forwardI. Retrieve the SSN_NUMBER of all employees whose name starts with N. Attribute First Name Last Name SSN Number Data Type Varchar(15) Varchar(15) Char(9) Not Null Not Null Constraint Primary Keyarrow_forwardThe Book table has the following columns: ID Title Author Genre Year Price Complete the SELECT statement to select the year and the average price of books for that year. SELECT *Type your code here */ FROM Book GROUP BY Pickarrow_forward
- Which clause of a SQL Select statement is required if we want to display aggregate data by category such as total population by state, department, etc.? Question 40 options: 1) GROUP BY 2) ORDER BY 3) WHERE 4) FROM 5) SELECTarrow_forwardAssume the PRODUCT table contains multiple rows. The following code would include: SELECT P_DESCRIPT, P_PRICE FROM PRODUCT WHERE P_CODE IN(SELECT P_CODE FROM LINE GROUP BY P_CODE HAVING COUNT(*) > 1); Group of answer choices A) Select the products that have been ordered before. B) Select the products that have been ordered at least once. C) Select the products that have been ordered at least twice. D) An error message.arrow_forwardA customers table has the following columns: ID, NAME, AGE, ADDRESS and SALARY. Write an SQL code that will fetch the ID, NAME and SALARY fields from the CUSTOMERS table where the Salary is greater than 2000. Show resultarrow_forward
- - The HR department needs a report to display employee information as shown from the job_history table. The months worked is the number of months from the start date to the end date. Only list those employees whose months worked is an even number. Order by months worked descendingarrow_forwardTable name: Products Column Role Data Type Length Constraint Name P ID Stores the ID of a product Number 8. Primary key P Name Stores the name of a product Varchar2 25 P_entryDate Stores the entry date of a product Stores the expiry date of a product Date Cannot be null P_Expiry P Expiry date should be greater than P entryDate Date P Price Stores the price of a product Number 3,2 Cannot be null a) Write in SQL a command that creates the table Products according to the above description (2 marks). b) Write in SQL a statement that adds to the table Products a new column named supplierID of type Number(5). This column should be defined as a foreign key that relates the table Products to the table Supplier (1.5 marks). c) Write in SQL a query that lists all the details of products arranged in descending order according to the entry date (1.5 marks).arrow_forwardFind the rep number, last name, and first name of each sales rep who represents at least one customer with a credit limit of $10.000arrow_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 PtrNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
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