-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnection2plantShopDB.session.sql
More file actions
92 lines (92 loc) · 1.7 KB
/
Connection2plantShopDB.session.sql
File metadata and controls
92 lines (92 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
USE sakila;
show tables;
INSERT INTO customer (
store_id,
first_name,
last_name,
email,
address_id,
active
)
VALUES (
1,
'Loukmane' 'Chaou',
'loukmane@chaou.com',
'address_id:smallint',
'active:tinyint',
);
SELECT *
FROM information_schema.columns
WHERE TABLE_SCHEMA = 'sakila' -- replace with your database name
AND TABLE_NAME = 'customer';
INSERT INTO address (
address,
city_id,
district,
postal_code,
phone,
location
)
VALUES (
'Friedbergerlandstraße 12',
601,
'Bockenheim',
'60311',
'0157039685',
POINT(0, 0)
);
SET @address_id := LAST_INSERT_ID();
SELECT *
from address
where address = 'Friedbergerlandstraße 12';
DELETE FROM address
where address = 'Friedbergerlandstraße 12';
SELECT *
FROM customer
WHERE first_name = 'Loukmane';
USE sakila;
START TRANSACTION;
INSERT INTO sakila.customer (
store_id,
first_name,
last_name,
email,
address_id,
active
)
VALUES (
1,
'Loukmane',
'Chaou',
'loukmane.chaou@email.com',
610,
1
);
COMMIT;
SELECT *
FROM sakila.customer
where first_name = "jo";
SELECT *
FROM city
INNER JOIN country
where city.country_id = country.country_id
AND country.country = "Germany";
INSERT INTO city (city, country_id)
VALUES ('Frankfurt am Main', 38);
INSERT INTO customer (
store_id,
first_name,
last_name,
email,
address_id,
active
)
VALUES (
2,
'jo',
'han',
'jo@mail.com',
1,
1
);
use sakila;