[SOLVED] SQL questions

20.00 $

Programming resource
, Digital learning resource
Categories: ,
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

Q1. (10 points)Create a view called Terms_odd in the AP database, which returns rows ofTerms table whose TermsID is an odd number and each row contains threecolumns: TID, Details, and DueDays, which are TermsID, TermsDescription,and TermsDueDays of Terms, respectively.
Note that your Terms_odd must be able to include not only terms in thecurrent Terms table but also terms that are modified later.*/
Q2. (30 points)Write one DML statement to perform each of the following tasks:

(a) Use Terms_odd to insert the following two new terms into Terms table:-The first new term Details is ‘Net due 100 days’ with DueDays of 100.-The second new term Details is ‘Net due 125 days’ with DueDays of 125.*/
(b) Use Terms_odd to change DueDays by increasing 15 days for terms whose    current DueDays is larger than 90. If a term is changed, whose corresponding
number in Details must also be changed together. For example, if DueDaysofa term is changed from 100 to 115, then, its Details ‘Net due 100 days’must
also change to ‘Net due 115 days’.    Hint: use REPLACE() of Chapter 8.*/

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.