Your SlideShare is downloading. ×
  • Like
BD Libreria | Consultas MYSQL
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

BD Libreria | Consultas MYSQL

  • 189 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
189
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. BASE DE DATOS MYSQL ISC. JOSÉ FRANCISCO ORTIZ MARTINEZ
  • 2. CREAR BASE DE DATOS CREATE DATABASE LIBRERIA; CREATE DATABASE NOMBRE;
  • 3. CREAR TABLA (DICCIONARIO DE DATOS) CREATETABLE LIBROS(ID_LIBRO INT UNSIGNED NOT NULLAUTO_INCREMENT ,NOMBRE VARCHAR(40) , AUTORVARCHAR(30), PAGINAS INT,PAISVARCHAR (30), PRIMARY KEY(ID_LIBRO)); CREATETABLE NOMBRE (COLUMNAS);
  • 4. INGRESAR DATOS. INSERT INTO LIBROS(NOMBRE, AUTOR, PAGINAS,PAIS)VALUES ("Laberinto de la soledad ", " Octavio Paz", "1500", "México"), ("Ecce homo", "Friedrich Nietzsche", "2500", "Alemania") , ("Lobo estepario", "Hermann Hesse", "1000", "Alemania"), ("Puertas al campo", "Octavio Paz", "900", "México"), ("Lobo estepario", "Hermann Hesse", "8000", "Alemania"); INSERT INTO NOMBRE (COLUMNAS)VALUES(DATOS);
  • 5. CONSULTAS MYSQL.
  • 6. SELECT CAMPOS FROMTABLA; SELECT * FROM LIBROS;
  • 7. SELECT * FROMTABLA ORDER BY CAMPO; ORDENAR DATOS A-Z SELECT * FROM LIBROS ORDER BY NOMBRE;
  • 8. SELECT * FROMTABLA ORDER BY CAMPO DESC; ORDENAR DATOS Z-A SELECT * FROM LIBROS ORDER BY NOMBRE DESC;
  • 9. SELECT CAMPOS FROMTABLA WHERE CAMPO="1"; SELECT * FROM LIBROS WHERE ID_LIBRO="1";
  • 10. SELECT CAMPOS FROMTABLA WHERE CAMPO>100; SELECT NOMBRE,PAGINAS FROM LIBROS WHERE PAGINAS>5000;
  • 11. MODIFICAR DATOS.
  • 12. UPDATETABLA SET CAMPO="DATO" WHERE ID_LIBRO="1"; UPDATE LIBROS SET PAGINAS="200" WHERE ID_LIBRO="1";
  • 13. ELIMINAR DATOS.
  • 14. DELETE FROMTABLAWHERE ID="1"; DELETE FROM LIBROSWHERE ID_LIBRO="1";
  • 15. Cuando la información se organiza, surgen las ideas. Jim Rohn