Créate database alumno
Enviado por Marie López • 27 de Agosto de 2017 • Apuntes • 287 Palabras (2 Páginas) • 77 Visitas
Página 1 de 2
Créate database alunmo;
- Show databases;
- Use alumno;
- Show tables;
- Créate table alumno(value 1, value 2,);
- Describe alumno;
- Insert into alumnos values(Value 1, value 2……);
- Select * from alumnos;
- Select apellido from alumnos;
- Select * from alumnos where sexo=”M”;
- Select * from alumnos where edad < 18;
- select * from alumnos where Nombre>= ‘L’;
- delete from alumnos where id =1;
- Primary key(name));
- Rename table administrativo to admin;
- Show tables;
- Rename table admin1 to administrativo1, admin2 to administrativo2;
- Update alumnos
Set Nombre= ‘Maria’
Where id=2;
- Select * from alumnos where edad <=18;
- Select * from alumnos where Nombre =’Jorge’;
- Select * from alumnos where Nombre <>’Jorge’;
- Select * from alumnos where edad >18;
- Select * from alumnos where Nombre like %maria%;(mostrara todo nombre que tenga maria)
- Select * from alumnos where Nombre like ‘_aria’;(mostrara todos los nombres con terminación aria).
- Select * from alumnos where sexo = ‘F’ and edad <=18;
- Select * from alumnos where sexo = ‘F’ or edad <=18;
- Select * from alumnos order by Nombre asc;
- Select * from alumnos order by Nombre desc;
- Select * from alumnos where Nombre between ‘Jorge ’ and ‘Maria’;
- Select count(*)(devuelve el total de filas seleccionadas);
- Select sum(*)(devuelve la suma total de la fila);
- Select min(*)(devuelve el valor minimo);
- Select max(*)(devuelve el valor maximo);
- Select AVG(*)(devuelve el valor de la mediana);
- drop database nombre;
- create table nuevatabla like tablavieja; (copiar tablas(solo estructura))
- create tabla nombretabla select * from tablavieja;
- drop table nombre;
- select nombre, apellido from alumnos order by sexo asc;
- select nombre, apellido from alumnos order by sexo desc;
- insert into alumnos values(‘jorge’,’guillen’……..);
- insert into alumnos( id, Nombre, apellido, sexo, edad,) values((‘jorge’,’guillen’……..);
- select * from alumnos where nombre <= ‘L’;
- SELECT personas.nombre, direccion, ciudades.nombre FROM personas, ciudades;
...
Disponible sólo en Clubensayos.com