forked from sagiassa/GameOn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUntitled-1.sql
More file actions
35 lines (26 loc) · 1.04 KB
/
Untitled-1.sql
File metadata and controls
35 lines (26 loc) · 1.04 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
use sql_project;
-- DROP TABLE user_filters;
-- CREATE TABLE user_filters (
-- id INT,
-- age VARCHAR(5),
-- sport TEXT,
-- level TEXT
-- )
-- INSERT INTO user_filters VALUES('1', '11-15', 'basketball', 'pro');
-- INSERT INTO user_filters VALUES('2', '15-17', 'basketball', 'not that bad');
-- INSERT INTO posts VALUES(null, 'basketball', 'M', '11-15', 'pro', '22/08/2019', '12:00', 'tel-aviv', 'kedem', 'the hood', 10)
-- INSERT INTO posts VALUES(null, 'basketball', 'M', '15-17', 'not that bad', '23/08/2019', '18:00', 'tel-aviv', 'tavor', 'the streets', 10)
-- SELECT p.day, p.time, p.city, p.cort_name, p.numOfPlayers
-- FROM posts AS p, user_filters AS u, users
-- WHERE users.user_id = 1
-- AND u.id = users.user_id
-- AND p.post_id= users.user_id;
-- AND p.level = u.level
-- AND p.age = u.level ;
-- SELECT p.day, p.time, p.city, p.cort_name, p.numOfPlayers
-- FROM posts AS p
-- WHERE p.time = "18:00";
--function that finds the users id by his his email::::::
-- SELECT user_id
-- FROM users AS u
-- WHERE u.email = "aka@gmail.com";