Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 1 . 7 LAB - Create Vehicle and EventVehicle tables ( Case study ) LAB ACTIVITY 1 1 . 7 . 1 : LAB
LAB Create Vehicle and EventVehicle tables Case study
LAB ACTIVITY
: LAB Create Vehicle and EventVehicle tables Case study
Refer to the completed table diagram in the zyBook case study. This lab implements four tables of the diagram:
A table diagram has tables Vehicle, Event, Officer, and VehicleEvent with columns as follows: Columns in the Vehicle table: VehicleID primary key TypeCode R YearNumber R MakeCode R ModelName R PlateID R StateCode R and RegistrationDate The composite column PlateID StateCode is unique. Columns in the Event table: EventNumber primary key EventDateTime R LocationDesc R ReportDesc, EventCode R CauseEventNumber, and ReportOfficerNumber R Columns in the Officer table: OfficerNumber primary key BadgeNumber R DepartmentCode R FullName R and RankCode. Columns in the VehicleEvent table: VehicleID and EventNumber. The primary key is Vehicle EventNumber The diagram has four arrows representing foreign keys: In the Event table, CauseEventNumber references the Event table and ReportOfficerNumber references the Officer table. In the VehicleEvent table, VehicleID references the Vehicle table and EventNumber references the Event table. All foreign key rules are restrict.
Do not create the Officer and Event tables. These tables are created, as examples, in Initialize.sql
Create the Vehicle and VehicleEvent tables. Implement all diagram constraints, including keys and cardinality, in SQL Specify data types based on the column name suffix:
ID fixed length, characters
Number unsigned integer
Code fixed length, characters
Name variable length, max characters
Date date
To confirm that all four tables have been created, add the SHOW TABLES; statement.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started