Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Microsoft SQL , design and create a database system called Auto _ Motors 1 . 2 Design and create the following table. 1 .

Using Microsoft SQL , design and create a database system called Auto_Motors 1.2 Design and create the following table. 1. Vehicles VehicleID as an integer, primary key. Make as a variable character string, not null. Model as a variable character string, not null. Year as an integer, not null. Price as a decimal. 1.3 Design and create the following table. 2. Customers CustomerID as an integer, primary key. FirstName as a variable character string, not null. LastName as a variable character string, not null. Phone as a variable character string. Email as a variable character string.
Add a table called Sales containing CustomerID and VehicleID
2.2 Add Constraints
Add a foreign key constraint that references VehicleID from the Vehicles table.
Ensure Email in the Customers table is unique across all entries.
Insert Data
A. Insert at least five records into the Vehicles table.
B. Insert at least five records into the Customer table.
3.2 Query Data
A. Write a query to list all vehicles made after the year 2015, including their make, model, and price
B. Write a SQL query to find the total number of vehicles each customer has purchased, listing customer's
name and the count of vehicles incorporating the Sales table with CustomerID and VehicleID.
3.3 Update Data
A. Write an SQL command to increase the price of all vehicles by 5% that were made before the year 2010.

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_2

Step: 3

blur-text-image_3

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

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions