Advance Database Lab 1 Tasks
Advance Database Lab 1 Tasks
1. Implement a database using IBM DB2 based on the outcome of Step #1 and #2.
2. Add two columns named Fee and Discount into Engagement table.
3. Create a view which shows only the events that is conducted outdoor. In your view
creation, make sure that it does not accept or process any events that are conducted
indoor.
4. What is the command used to see all the tables that you have created in the
database?
SELECT *
FROM EVENT
WHERE EVENT_TYPE = 'Outdoor'
b) List the name of event manager who has managed more than one engagement.
SELECT
CASE MONTH(e.Event_Date)
WHEN 1 THEN 'January'
WHEN 2 THEN 'February'
WHEN 3 THEN 'March'
WHEN 4 THEN 'April'
WHEN 5 THEN 'May'
WHEN 6 THEN 'June'
WHEN 7 THEN 'July'
WHEN 8 THEN 'August'
WHEN 9 THEN 'September'
WHEN 10 THEN 'October'
WHEN 11 THEN 'November'
WHEN 12 THEN 'December'
END AS "Month",
COUNT(*) AS "Number of Engagements"
FROM
Engagement e
WHERE
YEAR(e.Event_Date) = 2015
GROUP BY
MONTH(e.Event_Date)
ORDER BY
MONTH(e.Event_Date);
e) List out the description and the charge per day for all types of canopy.
g) List out the information of equipment that have not been used before.
SELECT *
FROM Equipment
WHERE EQUIP_ID NOT IN (
SELECT EQUIP_ID FROM EQUIUSE)
h) Show the most popular event of this company, as engaged by its clients.