-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab5.sql
More file actions
67 lines (52 loc) · 1.97 KB
/
lab5.sql
File metadata and controls
67 lines (52 loc) · 1.97 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
/*
-- rulare pe rand
-- create table my_brick_collection ( colour varchar2(10), shape varchar2(10), weight integer );
-- create table your_brick_collection ( height integer, width integer, depth integer, colour varchar2(10), shape varchar2(10) );
*/
/*
insert into my_brick_collection values ( 'red', 'cube', 10 );
insert into my_brick_collection values ( 'blue', 'cuboid', 8 );
insert into my_brick_collection values ( 'green', 'pyramid', 20 );
insert into my_brick_collection values ( 'green', 'pyramid', 20 );
insert into my_brick_collection values ( null, 'cuboid', 20 );
*/
/*
insert into your_brick_collection values ( 2, 2, 2, 'red', 'cube' );
insert into your_brick_collection values ( 2, 2, 2, 'blue', 'cube' );
insert into your_brick_collection values ( 2, 2, 8, null, 'cuboid' );
*/
desc my_brick_collection
select * from my_brick_collection;
select * from your_brick_collection;
select * from my_brick_collection union
select * from your_brick_collection;
-- select cu mouse acest block si rulare
select colour, shape from my_brick_collection
union
select colour, shape from your_brick_collection;
select colour, shape from my_brick_collection
union all
select colour, shape from your_brick_collection;
select distinct * from my_brick_collection;
select distinct shape from your_brick_collection;
select colour from my_brick_collection
union
select colour from your_brick_collection
order by colour;
select colour from my_brick_collection
union all
select colour from your_brick_collection
order by colour;
select colour, shape from my_brick_collection
minus
select colour, shape from your_brick_collection;
select colour, shape from your_brick_collection
intersect
select colour, shape from my_brick_collection;
select colour, shape from your_brick_collection
minus
select colour, shape from my_brick_collection;
select colour from my_brick_collection
intersect
select colour from your_brick_collection
order by colour;