Question
Write SQL commands to execute the following requests and write commands to verify that the command was executed correctly. Add a new row in the
Write SQL commands to execute the following requests and write commands to verify that the command was executed correctly.
Add a new row in the orders table with the following data: Order# = 1021, Customer# = 1009, order date = July 20, 2009
Modify the zip code on order 1017 to 33222
Save the changes permanently to the database
Add a new row in the orders table with the following data: Order# = 1022, customer# = 2000, order date = august 6, 2009
Add a new row in the orders table with the following data: order# = 1023, customer# = 1009, describe the error raised and what caused the error
Create a script using substitution variables that allows a user to set a new cost amount for a book based on the ISBN
Execute the script and set the following values: ISBN = 1059831198 and cost = $20.00
Execute a command that undoes the change in step 7
Delete order #1005. You need to address the master order record and the related detail records.
Execute a command that undoes the previous deletion.
Create a sequence for populating the customer# column of the customers table. When setting the start increment values, keep in mind that data already exists in the table. The options should be set to not cycle the values and not cache any values, and no minimum or maximum values should be declared
Add a new customer row by using the sequence created in Question 1. The only data currently available for the customer is as follows: last name = shoulders, first name = frank, and zip 23567.
Create a sequence that generates integers starting with the value 5. Each value should be three less than the previous value generated. The lowest possible value should be 0, and the sequence shouldnt be allowed to cycle. Name the sequence MY_FIRST_SEQ.
Issue a select statement that displays nextval, or my_first_seq three times. Because the value isnt being placed in a table, use the dual table in the FROM clause of the SLECT statement. What causes the error on the third SELECT?
Change the setting of MY_FIRST_SEQ so that the minimum value that can be generated is -1000
A new table has been requested to support tracking automated emails sent to customers create a table and add data as described below:
Table name: email_lob
Columns: emailed(numeric), emaildate(datetime), customer# (numeric)
Primary Key: emailed column define as an identity column
Add the following data rows and displayed resulted rows (if any errors occur, explain why the error is expected)
i.Emaildate = current date, customer# = 1007
ii.Emailid = specify to use the column default value, emaildate = current date, customer# = 1008
iii.Emailid = 25, emaildate = current date, customer# = 1009
Create a private synonym that enables you to reference the MY_FIRST_SEQ object as NUMGEN
Use a Select statement to view the CURRVAL of NUMGEN. Delete the NUMGEN synonym and MY_FIST_SEQ
Create a bitmap index on the CUSTOMERS table to speed up queries that search for customers based on their stat of residence. Verify that the index exists and then delete the index
Create a B-tree index on customers last name column. Verify that the index exists by querying the data dictionary. Remove the index from the database
Many queries search by the number of days to ship (number of days between the order and shipping dates). Create an index that might improve the performance of these queries.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started