-
Notifications
You must be signed in to change notification settings - Fork 0
/
Avaliacao II.sql
34 lines (29 loc) · 955 Bytes
/
Avaliacao II.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
create database saladeaula;
use saladeaula;
create table estudante(
ID int AUTO_INCREMENT NOT NULL PRIMARY KEY,
sexo varchar(1) NOT NULL,
idade int NOT NULL,
endereco varchar (1) NOT NULL,
tamfamilia varchar (3) NOT NULL,
tempoviagem int NOT NULL,
tempoestudo int NOT NULL,
materiasperdidas int NOT NULL,
reforco varchar (3) NOT NULL,
pagar varchar (3) NOT NULL,
extracurriculares varchar (3) NOT NULL,
superior varchar (3) NOT NULL,
internet varchar (3) NOT NULL,
namoro varchar (3) NOT NULL,
relfamilia int NOT NULL,
tempolivre int NOT NULL,
vidasocial int NOT NULL,
saude int NOT NULL,
faltas int NOT NULL
);
select * from estudante order by ID desc;
select *, count(ID) from estudante where sexo='F';
select * from estudante order by materiasperdidas;
select * from estudante order by faltas;
select count(ID) as Quantidade_Tuplas from estudante;
drop table estudante;