Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions your-code/create.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CREATE TABLE cars(ID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
VIN INT(54),
Manufacturer VARCHAR(50),
Model VARCHAR(50),
Year INT(54),
Color VARCHAR(50));

CREATE TABLE customers(ID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Customer_ID INT(50),
Name VARCHAR(50),
Phone_Number INT(50),
Email VARCHAR(50),
Address VARCHAR(50),
City VARCHAR(50),
State_Province VARCHAR(50),
Country VARCHAR(50),
Zip_Postal INT(50)
);

CREATE TABLE salespersons(ID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Staff_ID INT(50),
Staff_name VARCHAR(50),
Store VARCHAR(50));

CREATE TABLE invoices(ID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Invoice_Number INT(50),
VIN INT(50)
Date DATE,
Customer_ID INT(50),
Staff_ID INT(50));


Empty file removed your-code/delete.sql
Empty file.
Binary file added your-code/lab_mysql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions your-code/seeding.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
USE lab_mysql;

SET sql_mode = "NO_AUTO_VALUE_ON_ZERO";

INSERT INTO cars (VIN, Manufacturer, Model, Year, Color)
VALUES ('3K096I98581DHSNUP', 'Volkswagen', 'Tiguan', 2019, 'Blue'),
('ZM8G7BEUQZ97IH46V', 'Peugeot', 'Rifter', 2019, 'Red'),
('RKXVNNIHLVVZOUB4M', 'Ford', 'Fusion', 2018, 'White'),
('HKNDGS7CU31E9Z7JW', 'Toyota', 'RAV4', 2018, 'Silver'),
('DAM41UDN3CHU2WVF6', 'Volvo', 'V60', 2019, 'Gray'),
('DAM41UDN3CHU2WVF6', 'Volvo', 'V60 Cross Country', 2019, 'Gray');

INSERT INTO customers (Customer_ID, Name, Phone_Number,Email, Address, City, State_Province, Country, Zip_Postal)
VALUES ('10001', 'Pablo Picasso', '+34 636 17 63 82','-', 'Paseo de la Chopera, 14', 'Madrid', 'Madrid', 'Spain', '28045'),
('20001', 'Abraham Lincoln', '+1 305 907 7086','-', '120 SW 8th St', 'Miami', 'Florida', 'United States', '33130'),
('30001', 'Napoléon Bonaparte', '+33 1 79 75 40 00','-', '40 Rue du Colisée', 'Paris', 'Île-de-France', 'France', '75008');

INSERT INTO salespersons (Staff_ID, Staff_name, Store)
VALUES ('00001', 'Petey Cruiser', 'Madrid'),
('00002', 'Anna Sthesia', 'Barcelona'),
('00003', 'Paul Molive', 'Berlin'),
('00004', 'Gail Forcewind', 'Paris'),
('00005', 'Paige Turner', 'Mimia'),
('00006', 'Bob Frapples', 'Mexico City'),
('00007', 'Walter Melon', 'Amsterdam'),
('00008', 'Shonda Leer', 'São Paulo');

insert into invoices(Invoice_Number, Date, Car, Customer, Salesperson)
VALUES (852399038, '2018-08-22', 0, 1, 3),
(731166526, '2018-12-31', 3, 0, 5),
(271135104, '2019-01-22', 2, 2, 7);


Empty file removed your-code/update.sql
Empty file.