Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2019_TP2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nicolas.paschoud
2019_TP2
Commits
ebd0e9c0
Commit
ebd0e9c0
authored
5 years ago
by
nicolas.paschoud
Browse files
Options
Downloads
Patches
Plain Diff
Adding the login for file
parent
c4453c7e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
projet/db/hyperdrive.sql
+18
-8
18 additions, 8 deletions
projet/db/hyperdrive.sql
with
18 additions
and
8 deletions
projet/db/hyperdrive.sql
+
18
−
8
View file @
ebd0e9c0
...
@@ -22,12 +22,14 @@ CREATE TABLE IF NOT EXISTS Paths (
...
@@ -22,12 +22,14 @@ CREATE TABLE IF NOT EXISTS Paths (
CREATE
TABLE
IF
NOT
EXISTS
Files
(
CREATE
TABLE
IF
NOT
EXISTS
Files
(
file_id
varchar
(
100
)
NOT
NULL
,
file_id
varchar
(
100
)
NOT
NULL
,
file_name
varchar
(
50
)
NOT
NULL
,
file_name
varchar
(
50
)
NOT
NULL
,
login
varchar
(
60
)
NOT
NULL
,
paths
varchar
(
400
)
NOT
NULL
,
paths
varchar
(
400
)
NOT
NULL
,
lat
FLOAT
,
lat
FLOAT
,
lng
FLOAT
,
lng
FLOAT
,
addedon
INT
,
addedon
INT
,
PRIMARY
KEY
(
file_id
),
PRIMARY
KEY
(
file_id
),
FOREIGN
KEY
(
paths
)
REFERENCES
Paths
(
paths
)
FOREIGN
KEY
(
paths
)
REFERENCES
Paths
(
paths
),
FOREIGN
KEY
(
login
)
REFERENCES
Users
(
login
)
);
);
CREATE
TABLE
IF
NOT
EXISTS
Shares
(
CREATE
TABLE
IF
NOT
EXISTS
Shares
(
...
@@ -64,13 +66,13 @@ VALUES
...
@@ -64,13 +66,13 @@ VALUES
INSERT
INTO
Files
INSERT
INTO
Files
VALUES
VALUES
(
"abcd"
,
"un"
,
"/a"
,
46
.
2054
,
6
.
1459
),
(
"abcd"
,
"un"
,
'a'
,
"/a"
,
46
.
2054
,
6
.
1459
,
1576691707
),
(
"ab"
,
"deux"
,
"/a"
,
46
.
2054
,
6
.
1459
),
(
"ab"
,
"deux"
,
'a'
,
"/a"
,
46
.
2054
,
6
.
1459
,
1576691707
),
(
"@dfsg"
,
"trois"
,
"/c/test"
,
46
.
2054
,
6
.
1459
),
(
"@dfsg"
,
"trois"
,
'c'
,
"/c/test"
,
46
.
2054
,
6
.
1459
,
1576691707
),
(
"gbvaf"
,
"quatre"
,
"/b"
,
46
.
2054
,
6
.
1459
),
(
"gbvaf"
,
"quatre"
,
'b'
,
"/b"
,
46
.
2054
,
6
.
1459
,
1576691707
),
(
"dsfgh"
,
"cinq"
,
"/d"
,
46
.
2054
,
6
.
1459
),
(
"dsfgh"
,
"cinq"
,
'd'
,
"/d"
,
46
.
2054
,
6
.
1459
,
1576691707
),
(
"sdfa"
,
"six.txt"
,
"/e"
,
46
.
2054
,
6
.
1459
),
(
"sdfa"
,
"six.txt"
,
'e'
,
"/e"
,
46
.
2054
,
6
.
1459
,
1576691707
),
(
"liblb"
,
"myfile.txt"
,
"/n"
,
46
.
2054
,
6
.
1459
);
(
"liblb"
,
"myfile.txt"
,
'noe'
,
"/n"
,
46
.
2054
,
6
.
1459
,
1576691707
);
INSERT
INTO
Shares
INSERT
INTO
Shares
VALUES
VALUES
...
@@ -78,3 +80,11 @@ VALUES
...
@@ -78,3 +80,11 @@ VALUES
(
"a"
,
"c"
,
"abcd"
),
(
"a"
,
"c"
,
"abcd"
),
(
"a"
,
"d"
,
"abcd"
),
(
"a"
,
"d"
,
"abcd"
),
(
"c"
,
"e"
,
"@dfsg"
);
(
"c"
,
"e"
,
"@dfsg"
);
SELECT
Paths
.
paths
,
login
,
parent
,
Files
.
file_id
,
Files
.
file_name
FROM
Paths
LEFT
JOIN
Files
ON
Files
.
paths
=
Paths
.
paths
WHERE
Paths
.
login
=
'a'
AND
Paths
.
paths
=
'/a'
OR
Paths
.
parent
=
'/a'
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment