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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions your-code/Create the Database and Tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
create DATABASE lab_mysql;
Use lab_mysql;
Create TABLE IF NOT EXISTS lab_mysql.Cars(id INT PRIMARY KEY,
VIN VARCHAR(52),
Manufacturer VARCHAR(52),
Model VARCHAR(52),
Car_year INT NOT NULL,
Color VARCHAR(52));
Create TABLE IF NOT EXISTS lab_mysql.Costumers(id INT PRIMARY KEY,
Customer_ID INT NOT NULL,
Costumer_Name VARCHAR(52),
Phone VARCHAR(32),
Email VARCHAR (52) DEFAULT 'jonhdoe@gmail.com',
Adress VARCHAR (52),
City VARCHAR (52),
State_Province VARCHAR(52),
Country VARCHAR(52),
Postal INT NOT NULL);
Create TABLE IF NOT EXISTS lab_mysql.Salespersons(id INT PRIMARY KEY,
Staff_ID INT NOT NULL,
Name VARCHAR(52),
Store VARCHAR(52));
Create TABLE IF NOT EXISTS lab_mysql.Invoices(id INT PRIMARY KEY,
Invoice_number INT NOT NULL,
Invoice_Date DATE,
Car INT,
Costumer INT,
Sales_Person INT);

12 changes: 12 additions & 0 deletions your-code/Update records on Database.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
USE lab_mysql;
Update lab_mysql.costumers
SET email = 'ppicasso@gmail.com'
WHERE id = 0;
Update lab_mysql.costumers
SET email = 'lincoln@us.gov'
WHERE id = 1;
Update lab_mysql.costumers
SET email = 'hello@napoleon.me'
WHERE id = 2;

SELECT * FROM lab_mysql.costumers;
Empty file removed your-code/create.sql
Empty file.
5 changes: 5 additions & 0 deletions your-code/delete record from Database.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
USE lab_mysql;
DELETE FROM lab_mysql.cars
WHERE id in (4);

SELECT * from lab_mysql.cars;
Empty file removed your-code/delete.sql
Empty file.
28 changes: 28 additions & 0 deletions your-code/seeding the Database.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
USE lab_mysql;
INSERT INTO lab_mysql.cars(id, VIN, Manufacturer, Model, Car_year, Color)
VALUES(0, '3K096I98581DHSNUP', 'Volkswagen', 'Tiguan', 2019, 'Blue'),
(1, 'ZM8G7BEUQZ97IH46V', 'Peugeot', 'Rifter', 2019, 'Red'),
(2, 'RKXVNNIHLVVZOUB4M', 'Ford', 'Fusion', 2018, 'White'),
(3, 'HKNDGS7CU31E9Z7JW', 'Toyota', 'RAV4', '2018', 'Silver'),
(4, 'DAM41UDN3CHU2WVF6', 'Volvo', 'V60', 2019, 'Gray'),
(5, 'DAM41UDN3CHU2WVF6', 'Volvo', 'V60 Cross Country', 2019, 'Gray');

INSERT INTO lab_mysql.costumers(id, Customer_ID, Costumer_Name, Phone, Email, Adress, City, State_Province, Country, Postal)
VALUES(0 ,10001 , 'Pablo Picasso', '34636176382', '-', 'Paseo de la Chopera, 14,','Madrid' , 'Madrid', 'Spain', 28045),
(1 ,20001 , 'Abraham Lincoln', '13059077086', '-', '120 SW 8th St','Miami', 'Florida', 'United States', 33130),
(2 ,30001 , 'Napoléon Bonaparte', '33179754000', '-','40 Rue du Colisée',' Paris', 'Île-de-France', 'France', 75008);

INSERT INTO lab_mysql.salespersons(id,Staff_ID, Name, Store)
VALUES(0,00001 , 'Petey Cruiser' , 'Madrid'),
(1,00002 , 'Anna Sthesia', 'Barcelona'),
(2,00003 , 'Paul Molive', 'Berlin'),
(3,00004 , 'Gail Forcewind', 'Paris'),
(4,00005 , 'Paige Turner', 'Mimia'),
(5,00006 , 'Bob Finvoicesrapples', 'Mexico City'),
(6,00007 , 'Walter Melon', 'Amsterdam'),
(7,00008 , 'Shonda Leer', 'São Paulo');

INSERT INTO lab_mysql.invoices(id, Invoice_number, Invoice_Date, Car, Costumer, Sales_Person)
VALUES(0, 852399038 , 20180222 , 0 , 1 , 3),
(1, 271135104 , 20190122 , 2 , 2 , 7),
(2, 731166526 , 20181231 , 3 , 0 , 5);
Empty file removed your-code/seeding.sql
Empty file.
Empty file removed your-code/update.sql
Empty file.