-
Notifications
You must be signed in to change notification settings - Fork 0
/
console.sql
65 lines (40 loc) · 920 Bytes
/
console.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
65
use test1;
create table elev
(
elevID INT primary key auto_increment,
nume varchar(100),
prenume varchar(100),
email varchar(100),
clasaID INT,
Constraint Fk_clasaID
Foreign Key (clasaID) References clasa (clasaID)
);
create table clasa
(
clasaID INT primary key auto_increment,
clasa tinytext,
nr_elevi int check (nr_elevi between 0 and 40),
profesor INT
);
create table profesor
(
profID INT primary key auto_increment,
nume varchar(100),
prenume varchar(100),
materie varchar(100)
);
select *
from clasa;
select *
from elev;
select *
from profesor;
insert into elev (nume, prenume, email, clasaID)
values ("Bolba", "Denis", "[email protected]", null);
insert into clasa (clasa, nr_elevi)
values ("10D", 1);
alter table elev
drop constraint Fk_clasaID;
drop table elev;
drop table clasa;
drop table profesor;