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 6, Problem 6HOA
A new table has been requested to support tracking automated emails sent to customers. Create the table and add data as described below.
- Tablename: email_log
- Columns: emailid (numeric), emaildate (datetime), customer# (numeric)
- Primary key: emailid column, define as an Identity Column
- Add the following data rows and display resulting rows (if any errors occur, explain why the error is expected)
-
- 1. Emaildate = current date, customer# = 1007
- 2. Emailid = specify to use the column default value, emaildate = current date, customer# = 1008
- 3. Emailid = 25, emaildate = current date, customer# = 1009
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
1.
ID
Last Name
First Name
Create the My Employee table with the following fields:
Not Null
Number(4)
Varchar(25)
Varchar(25)
Varchar(8)
Number(9,2)
Userid
Salary
2. Add the constraint Primary Key (ID) to the table.
3. Insert the following data to the table:
ID Last Name
First Name
Ali
1
2
3
4
5
AlChameri
Alanizi
Hejazi
Turki
AlKamel
Rayen
Decham
Mohamed
Fahhed
4. Select all the data in the table.
Userid
raptel
bdancs
bbiri
cnewman
aropebur
I
Salary
795
860
1100
750
1550
PROBLEM:
Create a table named BOOK_STORES to include the columns listed in the following chart.
Column Name
Store_ID
Name
Contact
Rep_ID
Datatype
NUMBER (8)
VARCHAR2(30)
VARCHAR2(30)
VARCHAR2(5)
Constraint Comments
PRIMARY KEY column
Should be UNIQUE and NOT NULL
:
INSTRUCTIONS:
Submit the complete code on doc file, run and also submit the snapshot of the result. You can paste
the screen shots(2) on a MS. Word doc.
1- Create a NONGAME table with the following structure:
Column
Туpe
Length
Decimal Places Nulls Allowed? Description
ITEM NUM
CHAR
Primary Key
4
No
DESCRIPTION
CHAR
30
ON HAND
DECIMAL
4
CATEGORY
CHAR
3
PRICE
DECIMAL
2- Insert into the NONGAME table the item number, description, number of units on
hand, category, and unit price from the ITEM table for each item that is not in
category GME.
3- In the NONGAME table, change the description of item number DL51 to "Classic
Train Set".
4- In the NONGAME table, increase the price of each item in category TOY by two
percent. (Hint: Multiply each price by 1.02).
5- Add the following item to the NONGAME table: item number: TL92; description:
Dump Truck; number of units on hand: 10; category: TOY; and price: 59.95.
6- Delete every item in the NONGAME table for which the category is PZL.
7- In the NONGAME table, change the category for item FD11 to null.
8- Add a column named ON_HAND_VALUE to the NONGAME table. The on-hand
value is a seven-digit…
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
- Create a new table containing these four columns: Emp#, Lastname, Firstname, and Job_class. The table name should be EMPLOYEES. The Job_class column should be able to store character strings up to a maximum length of four, but the column values shouldn’t be padded if the value has less than four characters. The Emp# column contains a numeric ID and should allow a five-digit number. Use column sizes you consider suitable for the Firstname and Lastname columns.arrow_forwardWhat is the maximum number of columns you can define as a primary key when using the column-level approach to creating a table? a. 0 b. 1 c. 30 d. 255arrow_forwardAdd two columns to the EMPLOYEES table. One column, named EmpDate, contains the date of employment for each employee, and its default value should be the system date. The second column, named EndDate, contains employees date of termination.arrow_forward
- What is the purpose of a column alias?arrow_forwardCreate the following indexes: a. Create an index named TRIP_INDEX1 on the TRIP_NAME column in the TRIPtable. b. Create an index named TRIP_INDEX2 on the TYPE column in the TRIP table. c. Create an index named TRIP_INDEX3 on the LAST_NAME and FIRST_NAME columns in the CUSTOMER table.arrow_forwardAdd a constraint to make sure the Rep_ID value entered in the BOOK_STORES table is a valid value contained in the STORE_REPS table. The Rep_ID columns of both tables were initially created as different datatypes. Does this cause an error when adding the constraint? Make table modifications as needed so that you can add the required constraint.arrow_forward
- In the initial creation of a table, if a UNIQUE constraint is included for a composite column that requires the combination of entries in the specified columns to be unique, which of the following statements is correct? a. The constraint can be created only with the ALTER TABLE command. b. The constraint can be created only with the table-level approach. c. The constraint can be created only with the column-level approach. d. The constraint can be created only with the ALTER TABLE MODIFY command.arrow_forwardA new table has been requested to support tracking automated emails sent to customers.Create the table and add data as described below Tablename: email_logColumns: emailid (numeric), emaildate (datetime), customer# (numeric)Primary key: emailid column, define as an Identity Column Add the following data rows and display resulting rows (if any errors occur, explain why theerror is expected)arrow_forward
arrow_back_ios
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 LearningCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
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
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY