Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8 . 7 LAB - Create Vehicle and EventVehicle tables The California DMV ' s completed table diagram is presented in the zyBook. The following

8.7 LAB - Create Vehicle and EventVehicle tables
The California DMV's completed table diagram is presented in the zyBook. The following is a portion of the table diagram:
The diagram has four tables and four arrows depicting foreign keys. Table Vehicle has columns VehicleID, TypeCode R, YearNumber R, MakeCode R, ModelName R, PlateID R, StateCode R, and RegistrationDate. VehicleID is the primary key. (PlateID, StateCode) is unique. Table Event has columns EventNumber, EventDateTime R, LocationDesc R, ReportDesc, EventCode R, CauseEventNumber, and ReportOfficerNumer R. EventNumber is the primary key. Table Officer has columns OfficerNumber, BadgeNumber R, DepartmentCode R, FullName R, and RankCode. OfficerNumber is the primary key. (BadgeNumber, DepartmentCode) is unique. Table VehicleEvent has columns VehicleID and EventNumber. (VehicleID, EventNumber) is the primary key. VehicleID in the VehicleEvent table is a foreign key that references Vehicle, with caption restrict. EventNumber in the VehicleEvent table is a foreign key that references Event, with caption restrict. CauseEventNumber in the Event table is a foreign key that references Event, with caption set null. ReportOfficerNumber in the Event table is a foreign key that references Officer, with caption restrict.
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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

What are the main purposes of internal controls over cash receipts?

Answered: 1 week ago

Question

What was learned?

Answered: 1 week ago

Question

=+How might you explain this phenomenon?

Answered: 1 week ago