Spring 2023 ITM.304.HSF1 Managing Data Structures
Description
Week 11 SQL LAB : Randomize re_HouseSale DATES
Wednesday, January 4, 2023, 10:07 AMNumber of replies: 0
1. Check your re_HouseSale table : ( week 10 Homework )
SaleDate must be Date
Price must be a number
2. Randomize SaleDate in re_HouseSale table in your database :
200 records 60 Month forward,
150 records 75 Month forward,
170 records 8 years back,
- 300 records 5 years back.
HINT : use date_add() and date_sub() functions, use “limit 200” to specify number of records,
- update records with year (sales_date) = 2008 only
example:
update re_HouseSale set SaleDate = date_add( SaleDate, interval 5 year)
where year(SaleDate) = 2008 limit 200;
3. Display the number distinct ( unique) years in your re_HouseSale table.
Post your SQL for feedback
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."