-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathsesion2-pagila.sql
70 lines (45 loc) · 1.96 KB
/
sesion2-pagila.sql
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
-- Explorar tablas
SELECT * FROM actor;
SELECT * FROM actor WHERE last_name = 'WAHLBERG';
SELECT * FROM address;
SELECT * FROM address WHERE district = 'California';
SELECT * FROM address WHERE district = 'California' AND postal_code = '17886';
SELECT * FROM address WHERE district = 'California' AND postal_code = '17886' OR postal_code = '2299';
SELECT * FROM address WHERE postal_code = '17886' OR postal_code = '2299';
SELECT * FROM category;
SELECT * FROM category WHERE name = 'Action';
SELECT * FROM city;
SELECT * FROM city WHERE city = 'Akron';
SELECT * FROM city WHERE city LIKE 'A%';
SELECT * FROM country;
SELECT * FROM country WHERE country = 'Spain';
SELECT * FROM customer;
SELECT * FROM customer WHERE last_name = 'WILLIAMS';
SELECT * FROM customer WHERE activebool = FALSE;
SELECT * FROM customer WHERE activebool = TRUE;
UPDATE customer SET activebool = FALSE WHERE customer_id = 1;
UPDATE customer SET activebool = TRUE WHERE customer_id = 1;
SELECT * FROM film;
SELECT * FROM film WHERE description = 'A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies';
SELECT * FROM film WHERE description LIKE '%Drama%';
SELECT * FROM film_actor;
SELECT * FROM film_actor WHERE film_id = 1;
SELECT * FROM film_actor WHERE actor_id = 1;
SELECT * FROM film_category;
SELECT * FROM inventory;
SELECT * FROM language;
SELECT * FROM payment;
SELECT * FROM rental;
SELECT * FROM staff;
SELECT * FROM store;
-- insertar datos
select * from actor;
INSERT INTO actor (first_name, last_name) VALUES ('ALAN', 'SASTRE');
select * from customer;
select * from address;
select * from store;
INSERT INTO address (address, district, city_id, postal_code, phone)
VALUES ('Calle falsa', 'Nueva América', 300, '28004', '12334354352');
-- address 606
INSERT INTO customer(store_id, first_name, last_name, email, address_id, activebool, create_date)
VALUES (1, 'CUSTOMER NEW', 'LASTNAME EXAMPLE', '[email protected]', 606, TRUE, '2021-12-1');