Los Nueve Principios del Desempeño de la Sostenibilidad
Tablas de verdad (true tables)
1. Tablas de verdad
Como ya hemos dicho, una fórmula puede tomar los valores verdadero y falso. La semánticaes el
conjunto de reglas que permiten dar significado a una fórmula. El valor de una fórmula vendrá dado
por los operadores según las tablas de verdad. A partir de ahora, al valor falso le asignaremos el 0,
y al verdadero el 1.
Negación: La negación de un valor es su opuesto.
p not p
0 1
1 0
Conjunción: La conjunción de 2 valores sólo es cierta si ambos son verdaderos.
p q p and q
0 0 0
0 1 0
1 0 0
1 1 1
Disyunción: La disyunción de 2 valores sólo es falsa si ambos son falsos.
p q p or q
0 0 0
0 1 1
1 0 1
1 1 1
Condicional: La única posibilidad de que una condición o implicación sea falsa es si verdadero implica
falso (1 -> 0).
p q p -> q
0 0 1
0 1 1
1 0 0
1 1 1
Disyunción exclusiva: La disyunción exclusiva de 2 valores es verdadera si son diferentes, y falsa si
los 2 valores son iguales.
p q p xor q
0 0 0
0 1 1
1 0 1
1 1 0
A continuación, veremos cómo utilizar tablas de verdad. Queremos saber si las fórmulas not (p and
q) y (not p) or (not q) son equivalentes. Para ello utilizaremos las tablas de verdad para obtener el
resultado de las fórmulas, y si ambas dan el mismo resultado para cualquier combinación de valores
(sus tablas de verdad son iguales), serán equivalentes:
p q not p not q p and q not (p and q) (not p) or (not q)
0 0 1 1 0 1 1
0 1 1 0 0 1 1
1 0 0 1 0 1 1
1 1 0 0 1 0 0
Como se puede apreciar, las 2 fórmulas devuelven el mismo resultado. Son equivalentes.
Truth Tables
A formula can take the values true and false.
The semantics is the set of rules that give meaning to a formula.
The value of a formula is given by traders as truth tables.
2. From now, we will assign the false value 0, and the true 1.
denial:
The denial of a value is its opposite.
p not p
01
10
Conjunction: The conjunction of two values is only true if both are true.
p q p and q
000
010
100
111
Disjunction: The disjunction of two values only false if both are false.
p q p or q
000
011
101
111
Conditional: The only possibility that a condition or implication is false is false if true implies (1 ->
0).
p q p -> q
001
011
100
111
Exclusive disjunction: The exclusive disjunction is true if two values are different, and false if the
two values are equal.
p q p xor q
000
011
101
110
Then we will see how to use truth tables.
We want to know if formulas not (p and q) and (not p) or (not q) are equivalent.
We will use truth tables to get the result of the formula, and if both give the same result for any
combination of values (their truth tables are the same), are equivalent:
p q p q not p not q and not (p and q) (not p) or (not q)
0011011
0110011
1001011
1100100
As can be seen, the two formulas return the same result. Are equivalent.
Las tablas o entidades
3. Una tabla es un espacio abstracto de información ordenada según un criterio. Esta tabla se basa
en un índice único o compartido que facilita el acceso a los datos de la mejor y más rápida manera.
La tabla está compuesta por campos o atributos. Estos campos se pueden especificar de distintos
tipos, numéricos, campos de texto, de fecha, hora, etc.
La forma tradicional de representar una tabla es por medio de un listado en el cual su cabezales
serían los atributos y los renglones serían los datos almacenados.
Tables or entities
A table is an abstract space of information sorted according to a criterion. This table is based on a
single or shared index that provides access to data in the best and quickest way. The table is
composed of fields or attributes. These fields can be specified in different types, numeric, text
fields, date, time, etc..?? The traditional way of representing a table is through a list in which his
head would be the attributes and the rows would be stored data.
Las relaciones
Una relación es la forma en la cual van a interactuaro las entidades. Estas relaciones están
acompañadas por cardinalidades, que sirven para darle un sentido de navegabilidad al MER.
(Modelo Entidad Relación)
Las relaciones pueden o no generar tablas. Una relación entre dos tablas guarda datos
comunes a las dos.
relationships
A relationship is the form in which they will interactuaro entities. These relationships are
accompanied by cardinalities, which serve to give a sense of worthiness to MER. (Entity
Relationship Model)
Relationships can generate tables or not. A relationship between two tables stores data common
to both.
Manejadores de bases de datos.
Un manejador de base de datos o DBM, es un motor de software que se encarga de la
administración y el funcionamiento de la base de datos. Este puede ser de muchos tipos y
funcionar en distintos sistemas operativos. Algunos de los más conocidos son MySQL (para
s.o. Linux), Oracle (para s.o. Unix) o SQL Server de Microsft (para s.o. Windows)
Existen muchas aplicaciones que se distribuyen independientemente del DBM que sirve para
gestionar la base de datos. Crear tablas, borrarlas, modificarlas, generar consultas etc. Uno de
estos es phpMyAdmnin que gestiona MySQL y otros en servidores Linux.
Database managers.
A database manager or DBM, is a software engine which is responsible for the management and
operation of the database. This can be of many types and run on different operating systems.
Some of the most popular are MySQL (Linux OS), Oracle (Unix OS) or Microsft SQL Server (for
Windows OS)
Many applications are distributed independently of DBM that serves to manage the database.
Create tables, delete, modify, build queries etc. One of these is phpMyAdmnin managed MySQL
and other Linux servers.
SQL / Consultas
SQL es el lenguaje que se utiliza para interactuar con el DBM (manejador de base de datos). Es un
lenguaje de SCRIPT, que interroga al DBM y obtenemos respuestas. No importa el lenguaje de
programación que estemos utilizando ya que todos utilizan cláusulas SQL para realizar consultas.
Una consulta es la que envía el programa de software a la base de datos y luego la base de datos
retorna una respuesta.
4. SQL / Queries
SQL is the language used to interact with the DBM (database manager). It is a scripting language,
which interviews the DBM and get answers. No matter what programming language you're using,
and they all use SQL to query clauses.?? A query is sent by the software program to the database
and then the database returns a response.
Ej;
Quiero saber cuales son los datos de los usuarios que tienen edad mayor a 30 años.
SELECT * FROM USUARIOS WHERE EDAD>30;
Esto retornará todas las filas comprendientes a los usuarios que cumplan con esa condición. Las
filas estarán ordenadas según los atributos de la tabla. Ej: Id, Edad, Nombre, Apellido, etc. Esto
está indicado por el asterisco.
Ex;
I wanna know what are the details of users who are over 30 years old.??
SELECT * FROM users WHERE age> 30;?
? It returns all rows comprendientes users that meet that condition. The rows are ordered
according to the attributes of the table.
Ex: Id, Age, Name, Last Name, etc..
This is indicated by the asterisk.
Si solo quisiéramos el nombre del usuario sería de la siguiente manera.
SELECT NOMBRE FROM USUARIOS WHERE EDAD>30;
Restringir los datos retornados por la base de datos ayuda a agilizar las consultas y no gastar
tantos recursos del servidor. Cuantos mas recursos se ahorren, será más rápida la respuesta de
consultas para otros usuarios que a la misma vez están usando la base de dato.
If only the name of the user would like to be as follows.?
SELECT NAME FROM USERS WHERE AGE> 30;?
? Restrict the data returned by the database helps streamline the consultation and not spend so
many server resources.
The more resources are saved, will be faster query response to other users that they are using the
same data base.
para crear una tabla en MYSQL, primero debemos declararla con la instruccion:
CREATE TABLE seguido del nombre que deseamos que tenga nuestra tabla, despues abrimos
parentesis y declaramos las variables y el tipo de variable que son, por ultimo cerramos
parentesis& le agregamos punto y coma.
to create a table in MySQL, we must first declare it with the command:
CREATE TABLE followed by the name we want to have our table, after we open parenthesis and
declare variables and the variable type that are close parenthesis & finally we add a semicolon.
despues, con el comando: INSERT INTO VALUES le asignamos un valor a cada variable y de esta
forma llenamos nuestra tabla.
Las variables que cambian de casilla van separadas por coma y entre comillas.
Al final, se cierra el parentesis y agrega punto y coma.
Para mostrar la tabla, usamos el comando: SELECT * FROM seguido del nombre de la tabla y
terminado con un punto y coma.
Despues de esto, se muestra abajo nuestra tabla con los valores que le agregamos, ya llena.
5. Then with the command: INSERT INTO VALUES assign a value to each variable and so we fill our
table.
The variables that change box are separated by commas and quotation marks.
Finally, close the parentheses and semicolons added.
To display the table, use the command: SELECT * FROM followed by the name of the table and
ended with a semicolon.
After that, our table below shows the values that we add, already full.
primero, declaramos la tabla de esta manera:
En ALIGN le ponemos el tipo de alineacion que queremos, en este caso es centrado y se escribe
entre comillas en ingles: "center"
BGCOLOR es para que despues de el "igual" pongamos el codigo del color que queremos que sea el
background, o su nombre en mayusculas.
despues declaramos el BORDER que es su tamaño de ancho.
First, declare the table like this:
In ALIGN we put the type of alignment you want, in this case is centered and is enclosed in quotes
in English: "center"
BGCOLOR is that after the "same" color code say that we want the background, or his name in
capital letters.
then declare the size BORDER is wide
Despues, abrimos un <TR> y despues un <TD>
El <TR> es para que agreguemos informacion dentro de las celdas de la primera fila.
Su forma de cerrarse, es poniendo </TR> y si lo volcemos a abrir, se crea una segunda fila en
nuestra tabla para que le insertemos datos.
Los Datos se los insertamos con el <TD> .
Despues de ponerlo, ponemos los datos que deseamos que vayan dentro de la casilla.
Despues, para cerrarlo ponemos </TD> .
Si volvemos a abrir con otro <TD> se crea otra celda, dentro de la misma fila, con los datos que le
hayamos puesto dentro, hasta que lo volvamos a cerrar la casilla.
Por eso al terminar cada celda debemos agregarle el </TD> y ya que cerremos todas nuestras
casillas, cerrar la fila con el </TR>.
Then, open a <TR> and then a <TD>
The <TR> is to add information into cells in the first row.
Its closed form, is putting </ TR> and if volcemos to open, it creates a second row in our table to
which we insert data.
Data is the insert with <TD>.
After putting it, put the data we want to be in the box.
Then, to close we</ TD>.
If we open another <TD> creates another cell in the same row with the data that we put in, until
you return to close the box.
So after each cell we add the </ TD> and as we close all our boxes, close the row with the </ TR>.