From 1ca083aad0763f84e731c1c0f71b0800e8380c0c Mon Sep 17 00:00:00 2001 From: BrunexSantos Date: Sat, 22 Apr 2023 17:26:27 +0100 Subject: [PATCH] lab done --- your-code/ERD.JPG | Bin 0 -> 39013 bytes your-code/create.sql | 51 ++++++++++++++++++++++++++++++++++++++++++ your-code/delete.sql | 1 + your-code/seeding.sql | 31 +++++++++++++++++++++++++ your-code/update.sql | 6 +++++ 5 files changed, 89 insertions(+) create mode 100644 your-code/ERD.JPG diff --git a/your-code/ERD.JPG b/your-code/ERD.JPG new file mode 100644 index 0000000000000000000000000000000000000000..61421c0634929527efd35131e1ac79053b218eed GIT binary patch literal 39013 zcmeEv1wdBIy7r<|kdy`i=`QJ%miXwD?(R@RkPwj$LAs<7>5>pB>68ZPZjk<$o_+S# zefHjW?|aVu|8xK2Cu@DP=9@M1zVDhf^Tspd^~dWu;HHd(v;+VJ1qHZ+|A6cHoBQJK z7N!6oCkN000DuUqGzon1>2p3xWqg zv<{vSzodSAen{Yl1b#^1hXj5|;D-eM6D1((=wfR}rfgvAZ07{>4;KORRiD5H^@f}X z*q_t2QITKMFg%<95Eb=H`WM{-G4YH1e&`neiM{9t&p#yaLjpe}@IwMWB=Cy_*jU)u zd09Ak+1SWf@A86wY&^hkw;0U+?wtyW#1}FmtV9FUxe^E%T=TS(_ot^D@nVD^! zm<){V3{9Af>};6b4eXg&nOK+sej#^z10yRFXEH+*GYeY*>YchqYBCFB0cv$lITks4 zF%xqODNjceWlwn(BTp+M9%E`D!5hf@?!4|c_BJNY24wCw*0xT(?gHdrYv%>iU$U9W z1^FF~O?j2>N&Hj-yb>V)i553EHzqfBCObznW>y{^9%dFcW;QlPumq!%hpn@LJEN@= z#ZML7GjTFX1F|VnCDW{>aF(;#;0lP6HE32^qqk%Cy zE2A+xyYXF4R&F*^Rzvcinm0E3xpjLNN9(U`8yhj3Sew|G*g89b(qLsKXZ{<}|Ee}Y z5&higZ;Bt}5iG+i=4fKzY;q4g1iw6BMivf6Ha3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S`eO;ESoz^;!>-sf)+qjity3Dylsu3@bBG*5ql+$c+mBYl70xCR8O$fdQ3 zi?{3MWsOyX{qv4JpS}car~0&VXKywJ+uwlgmty3eu#V>Q(C6nQuYzurNu9WH=fI8*tu^G|nb^tWf#+BXK}Jnz8{+Nh?Y4Wobi$WJ zzwMC=?V!90R7ArB%H4PwTpHl+9D+_SmmIs26;IlWgyce?HJs-uYL~RNQ4D5d?wJ= ze05}66j(pL#p$_(*`iT5gSTkaqUSkmY7WW$=hgAw!BnM3F%}@;u;}?BsWp##Ll@ef zL-bqTQ$GXuRm?4hG_q+cRD|WTNrv5s*U05rJqcwDDwBPa&(N+ZVIG*$Xa_{h;$Pf7 z+Uj5jv5VKa_KoHTPCi6&j#NtT+&5hajI-#o$)E_kq*Xx)%V4Hj03kg$ve==tz6IW| z+sXuW9FM%?W3VO1Uh=}$4uSUuD*kg_Yh+V2ITX9l5CD@q}{bwv)S9R`=n-x zK;xJEf+_+U+B%6nuB7=?^+PM>fc=Tryr)~Vd({gf@nN-a5pCM=j$sq(@X7Uj8|FhK`2#L^YNldjbYaLM> zDgy7L$6ibGm(M?Pfm<#;+GNVrtx01z*6d2B+mCvkSSJQwnO-Y%w=~GpPpC2GvKT^x z#ZF(wL<(r#Q16s1by885E`;#pUw!r6@SxgOJD^!oya8sCKDPod^={wC&2X?KT$-GQJ-ydJiE`V44nJv*|_X{7g{T|iXf$stk{Or zdWwYe24$01tp{T^dN7;;%KGBmT4s!iS;UUC51qeXtmuF8H~)`xG5*&5=W`qXp3}eF Joa%ml`8~=2TDt%M literal 0 HcmV?d00001 diff --git a/your-code/create.sql b/your-code/create.sql index e69de29..9783fe6 100644 --- a/your-code/create.sql +++ b/your-code/create.sql @@ -0,0 +1,51 @@ +USE lab_mysql; + +CREATE TABLE car (VIN INT, manufacturer VARCHAR(20), + model VARCHAR(20), year_car timestamp, color VARCHAR(20)); + +CREATE TABLE invoices (invoice_number INT, invoice_date timestamp, + model VARCHAR(20), year_car timestamp, VIN INT, costumer_id int, staff_id INT); + +CREATE TABLE salesperson (staff_number INT AUTO_INCREMENT PRIMARY KEY, staff_id INT, + staff_name VARCHAR(20), store VARCHAR(20)); + +CREATE TABLE costumer (costumer_number INT AUTO_INCREMENT PRIMARY KEY, costumer_id INT, + name VARCHAR(20), phone_number VARCHAR(20), email VARCHAR(20) , address VARCHAR(20), city VARCHAR(20), state VARCHAR(20), country VARCHAR(20), ZIP VARCHAR(20)); + +ALTER TABLE car +ADD CONSTRAINT primary_car_key PRIMARY KEY (VIN); + + +ALTER TABLE invoices +ADD CONSTRAINT primary_invoices_key PRIMARY KEY (invoice_number); + +ALTER TABLE invoices +ADD CONSTRAINT foreign_invoices_key FOREIGN KEY (car_id) +REFERENCES car (ID); + +CREATE INDEX idx_costumer_id +ON costumer (costumer_id); + +ALTER TABLE invoices +ADD CONSTRAINT foreign_invoices_key4 FOREIGN KEY (costumer_id) +REFERENCES costumer (costumer_id); + +CREATE INDEX idx_staff_id +ON salesperson (staff_id); + +ALTER TABLE invoices +ADD CONSTRAINT foreign_invoices_key5 FOREIGN KEY (staff_id) +REFERENCES salesperson (staff_id); + +ALTER TABLE car +ADD COLUMN ID INT AUTO_INCREMENT PRIMARY KEY; + +ALTER TABLE invoices +ADD COLUMN ID INT AUTO_INCREMENT PRIMARY KEY; + +ALTER TABLE car +DROP CONSTRAINT primary_car_key ; + +ALTER TABLE car +ADD COLUMN ID INT AUTO_INCREMENT PRIMARY KEY; + diff --git a/your-code/delete.sql b/your-code/delete.sql index e69de29..56bd700 100644 --- a/your-code/delete.sql +++ b/your-code/delete.sql @@ -0,0 +1 @@ +DELETE FROM lab_mysql.car WHERE (`ID` = '6'); \ No newline at end of file diff --git a/your-code/seeding.sql b/your-code/seeding.sql index e69de29..c0d5a3b 100644 --- a/your-code/seeding.sql +++ b/your-code/seeding.sql @@ -0,0 +1,31 @@ +SET sql_mode = "NO_AUTO_VALUE_ON_ZERO"; + +INSERT INTO lab_mysql.car (VIN, manufacturer, model, year_car, 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 lab_mysql.costumer (costumer_id, name, phone_number, address, city,state,country,ZIP) +Values ( 10001 , 'Pablo Picasso', '+34 636 17 63 82', 'Paseo de la Chopera, 14', 'Madrid','Madrid','Spain', "28045" ); + +INSERT INTO lab_mysql.costumer (costumer_id, name, phone_number, address, city,state,country,ZIP) +Values ( 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 lab_mysql.invoices (invoice_number, invoice_date, car_id, costumer_id, staff_id) +Values ('852399038', 22-08-2018, 0, 1, 3 ); + +INSERT INTO lab_mysql.salesperson (staff_id, name, store) +Values ('00001', 'Petey Cruiser', 'Madrid'), + ('00002', ' 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' ); + + diff --git a/your-code/update.sql b/your-code/update.sql index e69de29..361dfc9 100644 --- a/your-code/update.sql +++ b/your-code/update.sql @@ -0,0 +1,6 @@ +UPDATE lab_mysql.salesperson SET store = 'Miami' WHERE (staff_number = 5); + +UPDATE lab_mysql.costumer SET `email` = 'ppicasso@gmail.com' WHERE (`costumer_number` = '1'); +UPDATE lab_mysql.costumer SET `email` = 'lincoln@us.gov' WHERE (`costumer_number` = '2'); +UPDATE lab_mysql.costumer SET `email` = 'hello@napoleon.me' WHERE (`costumer_number` = '3'); +