J une value without generating an Oracle 12c error message. If you attempt to ad
ID: 3689618 • Letter: J
Question
J une value without generating an Oracle 12c error message. If you attempt to add a record that violates a NOT NULL Constraint, a blank space is inserted automatically in the appropriate column so that Oracle 12c can complete the DML operation. None of the above statements is correct. c. d. 20. What is the maximum number of records that can be modified with a single UPDATE command? a. 1 b. 2 C. 3 d. unlimited Hands-On Assignments To perform the following assignments, refer to the tables created in the JLDB Build 5.sql scrip at the beginning of the chapter. 1. Add a new row in the ORDERS table with the following data: Order# = 1021, Customer 1009, and Order date = July 20, 2009. 2. Modify the zip code on order 1017 to 33222. 3. Save the changes permanently to the database.Explanation / Answer
DML(Data Manipulation Language) commands
1.Insert a row
insert into <tablename> (attributeName1,attributeName2,attributeName3,..)
Values(value1,value2,value3)
To insert values Order#1021,Customer#=1009, OrderDate=July 20,2009
into Orders table
SQL-Query:
insret into Orders(Order#,Customer#, OrderDate)
Values('1021','1009','20-JUL-09');
2.Update row
Set shipzip=33222 where the Order#=1017
Format for update row
Update <tablename> set attributename=value where attribute=value
SQL-Query
Update Orders set shipzip='33222' where Order#='1017'
3.To save the transactions
Commit;
The command Commit; permanently write the values to the database
upto that transaction to data base successfully.
4.
insert sql-Query:
insret into Orders(Order#,Customer#, OrderDate)
Values('1022','2000','06-Aug-09');
Result:
Error report: SQL Error: ORA-02291: integrity constraint (HR.ORDERS_CUSTOMER#_FK)
Error Explanation:
The Orders table Order# is Primary key and Customer# is foreign key
The Customer #=2000 is not existed in the customer table .
The error is integrity constraing error raised.
There is no customer #=2000 in the Customer table.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.