Question: PLEASE HELP! The SQL below creates the Officer and Event tables. Create the Vehicle and VehicleEvent tables with columns matching the table diagram above and

PLEASE HELP!

The SQL below creates the Officer and Event tables.

Create the Vehicle and VehicleEvent tables with columns matching the table diagram above and with the appropriate keys and constraints. Some additional notes:

All "ID", "Number", and "Code" columns should use unsigned INT data types.

All primary keys should auto-increment.

The vehicle's model name should be limited to 20 characters.PLEASE HELP! The SQL below creates the Officer and Event tables. Createthe Vehicle and VehicleEvent tables with columns matching the table diagram aboveand with the appropriate keys and constraints. Some additional notes: All "ID",

The SQL below creates the Officer and Event tables. Create the Vehicle and VehicleEvent tables with columns matching the table diagram above and with the appropriate keys and constraints. Some additional notes: - All "ID', "Number", and 'Code' columns should use unsigned INT data types. - All primary keys should auto-increment. - The vehicle's model name should be limited to 20 characters. \( \begin{aligned} 1 & \text { CREATE TABLE Officer ( } \\ 2 & \text { OfficerNumber INT UNSIGNED AUTO_INCREMENT, } \\ 3 & \text { Badgenumber INT NOT NULL, } \\ 4 & \text { DepartmentName VARCHAR(30) NOT NULL, } \\ 5 & \text { FUIIName VARCHAR(30) NOT NULL, } \\ 6 & \text { RankCode CHAR(3), } \\ 7 & \text { PRIMARY KEY (OfficerNumber), } \\ 8 & \text { UNIQUE (Badgenumber, DepartmentName) } \\ 9 & \text {; }\end{aligned} \) Explore the database and run your program as often as you'd like, before submitting for grading. Click Run program and observe the program's output in the second box. \begin{tabular}{l|l} & \\ 11 & CREATE TABLE Event ( \\ 12 & EventNUmber INT UNSIGNED AUTO_INCREMENT, \\ 13 & EventDateTime DATETIME NOT NULL, \\ 14 & LocationDesC TEXT(1900) NOT NULL, \\ 15 & ReportDesC TEXT(5000), \\ 16 & EventCode CHAR(2) NOT NULL, \\ 17 & CauseEventNumber INT UNSIGNED, \\ 18 & ReportofficerNumber INT UNSIGNED NOT NULL, \\ 19 & PRIMARY KEY (EventNUmber), \\ 20 & FOREIGN KEY (CauseEventNumber) \\ 21 & REFERENCES Event (EventNumber) \\ 22 & ON UPDATE SET NULL \\ 23 & ON DELETE SET NULL, \\ 24 & FOREIGN KEY (ReportofficerNumber) \\ 25 & REFERENCES Officer (OfficerNumber) \\ 26 & ON UPDATE RESTRICT \\ 27 & ON DELETE RESTRICT \end{tabular} Main.sql Load default template... Explore the database and run your program as often as you'd like, before submitting for grading. Click Run program and observe the program's output in the second box

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 Databases Questions!