Question: Create a database and write two queries following the instructions. In MySQL workbench, create a simple three table database to store information for a vegetable

Create a database and write two queries following the instructions.

In MySQL workbench, create a simple three table database to store information for a vegetable garden as follows:

Table Vegetable(vegId, vegName, spaceReq, notes)

Table GardenBed (bedId, size, lastRestedEndDate, lastFertilisedDate)

Table BedPlanting (bedId, vegId, plantingDate, expectedHarvestDate, harvestDate)

Note: This is not meant to be a complete solution. lastRestEndDate is important for giving garden beds a rest between crop plantings. A garden bed can have more than one vegetable planted in it as long as the size is not exceeded by the plants' space requirements.

1. Create the tables assigning primary and foreign keys and selecting appropriate data types;

2. Forward engineer so that a script is created and save the script to a place where you can find it to attach when ready for submission;

3. Run the script and test the server to ensure correct. (10 marks)

4. Write a useful query to join the three tables so that the result of the query shows a selection of columns and is sorted.

5. You can check your query by adding some data to your tables and executing the query.

6. Save your query in a file as Query 1 in a place where you can easily find it. (4 marks)

7. Write your own useful query, test and save as Query 2. Remember to demonstrate your SQL skills. (6 marks)

Instructions to attach the three (3) SQL script files

The first file to be attached is your database creation script. Browse your computer files, select the file, save and then move onto the next question to attach your query 1 file. The final question will let you attach your query 2 file.

Well done you will be finished once you have attached these files.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!