Using SQL Lite to code, provide code solutions 8. Now insert the following two e
ID: 3877035 • Letter: U
Question
Using SQL Lite to code, provide code solutions
8. Now insert the following two entries into the EQUIP-ASSIGN-LOG table 1- Assign the AC Monitor to the Evergreen project at its current rate starting at the the current date/time. The end date is not known at this time. 2- Assign the AC Monitor to the Amber Wave project at its current rate starting at the the current date/time. The end date is not known at this time. Note that you will have to use this syntax because you will not enter a value for the ID due to the auto increment: INSERT INTO tablename (columnlist) VALUES (valuelist); Test with a select query (but don't include that in your submission).Explanation / Answer
1- First we will assign bvalues in equipment table and then use the P.K in EQUIP_ASSIGN_LOG table:
INSERT INTO EQUIPMENT(EQUIP_NUM, EQUIP_NAME) VALUES(123,"AC Monitor")
INSERT INTO EQUIP_ASSIGN_LOG(EQUIP_ASSIGN_ID ,EQUIP_ASSIGN_BEGIN, EQUIP_NUM , PROJ_NUM) VALUES("1234",SELECT CURRENT_TIMESTAMP,SELECT EQUIP_NUM FROM EQUIPMENT EQUI WHERE EQUI .EQUIP_NAME= "AC Monitor",SELECT PROJ_NUM FROM PROJECT PRO WHERE PRO .PROJ_NAME= "Evergreen Project")
2- INSERT INTO EQUIP_ASSIGN_LOG(EQUIP_ASSIGN_ID ,EQUIP_ASSIGN_BEGIN, EQUIP_NUM , PROJ_NUM) VALUES("1235",SELECT CURRENT_TIMESTAMP,SELECT EQUIP_NUM FROM EQUIPMENT EQUI WHERE EQUI .EQUIP_NAME= "AC Monitor",SELECT PROJ_NUM FROM PROJECT PRO WHERE PRO .PROJ_NAME= "Amber Wave Project")
here we will fetch the beign time from the current timestamp and we will fetch the value of PROJ_NUM using select query by getting the appropriate project number from project table.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.