\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{MiliC\_} \pdfinfo{ /Title (mysql.pdf) /Creator (Cheatography) /Author (MiliC\_) /Subject (Mysql Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Mysql Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{MiliC\_} via \textcolor{DarkBackground}{\uline{cheatography.com/198734/cs/42090/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}MiliC\_ \\ \uline{cheatography.com/milic} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 21st January, 2024.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Data Definition Language (DDL)}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{CREATE DATABASE }} {\emph{db\_name}} (field\_1 type\_1 constraint\_1 , ... , field\_n type\_n constraint\_n , \seqsplit{any\_extra\_constraints} ); & Crea una database \tn % Row Count 7 (+ 7) % Row 1 \SetRowColor{white} {\bf{SHOW DATABASES}}; & Lista databases \tn % Row Count 8 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{USE}} {\emph{db\_name}}; & Cambia de db \tn % Row Count 9 (+ 1) % Row 3 \SetRowColor{white} {\bf{DROP DATABASE}} {\emph{db\_name}}; & Elimina db \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{} \tn % Row Count 11 (+ 0) % Row 5 \SetRowColor{white} {\bf{SHOW TABLES}}; & Lista las tablas de la base de datos actual \tn % Row Count 14 (+ 3) % Row 6 \SetRowColor{LightBackground} {\bf{SHOW FIELDS FROM}} {\emph{table}}; & Lista los campos de la tabla {\emph{table}} \tn % Row Count 16 (+ 2) % Row 7 \SetRowColor{white} {\bf{DESC}} {\emph{table}}; & muestra la estructura de la tabla \tn % Row Count 18 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{SHOW CREATE TABLE}} {\emph{table}}; & muestra el CREATE TABLE de la tabla \tn % Row Count 20 (+ 2) % Row 9 \SetRowColor{white} {\bf{DROP TABLE}} {\emph{table}}; & Elimina la tabla \tn % Row Count 22 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{ALTER TABLE}} {\emph{table}} {\bf{ADD}} \textless{}constraint\textgreater{} & Añade una constraint a la tabla {\emph{table}} \tn % Row Count 25 (+ 3) % Row 11 \SetRowColor{white} {\bf{ALTER TABLE}} {\emph{table}} {\bf{ADD COLUMN}} \textless{}column\_name column\_definition \textgreater{} & Añade una columna a la tabla {\emph{table}} \tn % Row Count 29 (+ 4) % Row 12 \SetRowColor{LightBackground} {\bf{ALTER TABLE}} {\emph{table}} {\bf{DROP COLUMN}} \textless{}column\_name\textgreater{} & Elimina una columna a la tabla {\emph{table}} \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Data Definition Language (DDL) (cont)}} \tn % Row 13 \SetRowColor{LightBackground} {\bf{INSERT INTO}} {\emph{table}} (col1,...,coln) {\bf{VALUES}} (val1,...,valn); & Inserta un registro en la tabla con los valores especificados para cada campo segun el orden en {\bf{VALUES}} \tn % Row Count 6 (+ 6) % Row 14 \SetRowColor{white} {\bf{UPDATE}} {\emph{table}} {\bf{SET}} col1 = val1, ..., {\bf{WHERE}} {\emph{condition}}; & Actualiza los valores de las columnas a los especificados en los registros que cumplan con las condiciones del WHERE \tn % Row Count 12 (+ 6) % Row 15 \SetRowColor{LightBackground} {\bf{DELETE FROM}} {\emph{table}} {\bf{WHERE}} condition; & Elimina los registros que cumplen las condiciones del WHERE \tn % Row Count 15 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{permite especificar, administrar y actualizar la base de datos.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.14011 cm} x{2.83689 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Data Types}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{char(n)}} & String de tamaño fijo n \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{varchar(n)}} & String de tamaño variable, con largo maximo n \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{int}} & nros. entero \tn % Row Count 6 (+ 1) % Row 3 \SetRowColor{white} {\bf{double precision}} & Nro. de punto flotante de doble precisión. \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{json}} & Objetos JSON \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} {\bf{date}} & fechas sin componente de tiempo. \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{datetime}} & fechas con componente de tiempo. \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} {\bf{enum}}('type\_1,...,'type\_n') & lista enumerada de valores permitidos \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.33919 cm} x{2.63781 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{OPERACIONES DE CONJUNTO}} \tn % Row 0 \SetRowColor{LightBackground} (query) {\bf{UNION {[}ALL{]}}} (query) & Realiza la unión entre las respuestas de ambas queries \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} (query) {\bf{INTERSECT {[}ALL{]}}} (query) & Realiza la intersección entre las respuestas de ambas queries \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} (query) {\bf{EXCEPT {[}ALL{]}}} (query) & Realiza la resta entre la respuesta de la primera query menos la respuesta de la segunda query \tn % Row Count 11 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Expresiones / Funciones utiles}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{COUNT}}({\bf{IF}}(expression, value\_if\_true, value\_if\_false)) & Podemos utilizarlo para contar las filas que cumplan la expresion con value\_true = 1 y value\_false = 0 \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} {\bf{COALESCE}}(val\_nuleable, nuevo\_val) & se usa para reemplazar un valor "null" retornado en una consulta. \tn % Row Count 10 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Constraints}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{PRIMARY KEY}}(col1, ...,coln) & Define a las columnas col\_i como claves primarias (PK) de la tabla. Son {\bf{UNIQUE}} y {\bf{NOT NULL}} \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} {\bf{NOT NULL}} & La columna no puede tener valores nulos \tn % Row Count 7 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{UNIQUE}} & La columna no puede tener valores repetidos \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} {\bf{AUTO\_INCREMENT}} & Genera identificadores unicos para las nuevas filas \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{FOREING KEY}} (col\_1, ...,col\_n) {\bf{REFERENCES}} {\emph{table(field)}} {[}{\bf{ON DELETE}} option{]} {[}{\bf{ON UPDATE}} option{]}: & Indica que los valores de las columnas col\_1,...,col\_n deben corresponderse con los valores de el/los campo/s {\emph{field}} de la tabla {\emph{table}}.Si la restricción es violada, ON DELETE | ON UPDATE establecen como actuar. \tn % Row Count 24 (+ 11) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Data Manipulation Language (DML)}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{SELECT}} (col\_1, .., col\_n) {[}AS *alias{]} & Elige las columnas a devolder en la respuesta \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{SELECT DISTINCT}} (col\_1, .., col\_n) & Devuelve las columnas seleccionadas sin duplicados \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{FROM}} {\emph{table}} {[}AS {\emph{alias}}{]} & Elige la tabla o tablas en las que buscar los registros, si eligo mas de una tabla se hace producto cartesiano entre ellas \tn % Row Count 13 (+ 7) % Row 3 \SetRowColor{white} {\bf{WHERE}} {\emph{condition}} & Filtra dejando solo los registros que cumplen con la condicion especificada \tn % Row Count 17 (+ 4) % Row 4 \SetRowColor{LightBackground} {\bf{ORDER BY}} {\emph{column}} {\bf{{[}ASC |DESC{]} {[}LIMIT}} {\emph{int}} {\bf{{]}}} & Ordena según la/s columna/s especificada/s en orden {\bf{ASC}} o {\bf{DESC}} y motrando tantos resultados como indique {\bf{LIMIT}} \tn % Row Count 24 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Funciones de agregación}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{MAX}}() & busca el maximo \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{MIN}}() & busca el minimo \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{AVG}}() & calcula el promedio \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} {\bf{COUNT}}() | {\bf{COUNT}}({\emph{¨}}DISTINCT**) & cuenta las filas (con o sin repeticion) \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{SUM}}() & suma los valores de las filas \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Las agregaciones se realizan en los grupos especificados por el {\bf{GROUP BY}} , A igual valor, mismo grupo.Si se omite el GROUP BY, todas las filas se tratan como parte de un solo grupo. \newline \newline Las columnas en el SELECT que no sean agregadas deben aparecer en el GROUP BY.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Consultas Anidadas}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{SET MEMBERSHIP (IN | NOT IN)}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{SELECT}} ... {\bf{FROM}} ... {\bf{WHERE}} (columns) {\bf{IN }} {[}SUBQUERY{]} ó {[}ENUMERATION{]} & Sirve para filtrar las columnas manteniendo las que coincidan con alguno de los valores resultantes de la subquery o enumeración \tn % Row Count 8 (+ 7) % Row 2 \SetRowColor{LightBackground} {\bf{SELECT}} ... {\bf{FROM}} ... {\bf{WHERE}} (columns) {\bf{ NOT IN }} {[}SUBQUERY{]} ó {[}ENUMERATION{]} & Sirve para excluir las columnas cuyos valores sean la respuesta de la subquery o estén mencionados en la enumeración \tn % Row Count 14 (+ 6) % Row 3 \SetRowColor{white} {\bf{SET COMPARISON (SOME | ALL)}} & comp = \{\textgreater{}, \textless{}, \textgreater{}=, \textless{}=, =, \textless{}\textgreater{}\} \tn % Row Count 16 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{SELECT}} ... {\bf{FROM}} ... {\bf{WHERE}} (columns) comp {\bf{SOME}} {[}SUBQUERY{]} & significa que la condición será verdadera si la operación es verdadera para cualquiera (o alguno) de los valores del rango. \tn % Row Count 23 (+ 7) % Row 5 \SetRowColor{white} {\bf{SELECT}} ... {\bf{FROM}} ... {\bf{WHERE}} (columns) comp {\bf{ALL}} {[}SUBQUERY{]} & significa que la condición será verdadera solo si la operación es verdadera para todos los valores del rango. \tn % Row Count 29 (+ 6) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{EMPTY RELATIONS (EXISTS | NOT EXISTS)}}} \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Consultas Anidadas (cont)}} \tn % Row 7 \SetRowColor{LightBackground} {\bf{SELECT}} ... {\bf{FROM}} ... {\bf{WHERE EXISTS}} {[}SUBQUERY{]} & El operador EXISTS devuelve VERDADERO si la subconsulta devuelve uno o más registros, Se utiliza para probar la existencia de algún registro en una subconsulta. \tn % Row Count 9 (+ 9) % Row 8 \SetRowColor{white} {\bf{SELECT}} ... {\bf{FROM}} ... {\bf{WHERE NOT EXISTS}} {[}SUBQUERY{]} & El operador NOT EXISTS devuelve VERDADERO si la subconsulta no devuelve ningun registro, Se utiliza para probar la NO existencia de algún registro en una subconsulta. \tn % Row Count 18 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Una subquery es una consulta anidada en un {\bf{WHERE}} un {\bf{FROM}} o una {\bf{Columna}} -\textgreater{} query escalar} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.68655 cm} x{1.87657 cm} x{2.01388 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{JOINS}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{INNER JOIN}} & FROM A INNER JOIN B ON join\_condition & Selecciona todas las filas de las tablas A y B donde la condición del join se satisface. \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} {\bf{LEFT JOIN}} & FROM A LEFT JOIN B ON join\_condition & Selecciona todas las filas de las tablas A y aquellas de la tabla B donde la condición del join se satisface. \tn % Row Count 13 (+ 7) % Row 2 \SetRowColor{LightBackground} {\bf{RIGHT JOIN}} & FROM A RIGHT JOIN B ON join\_condition & Selecciona todas las filas de las tablas B y aquellas de la tabla A donde la condición del join se satisface. \tn % Row Count 20 (+ 7) % Row 3 \SetRowColor{white} {\bf{FULL JOIN}} & FROM A FULL JOIN B ON join\_condition & Selecciona todas las filas de las tablas A y B \seqsplit{independientemente} de si la condición del join se satisface. \tn % Row Count 27 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.04057 cm} x{2.93643 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{HAVING}} \tn % Row 0 \SetRowColor{LightBackground} {[}{\bf{HAVING}} where\_condition{]} & permite filtrar grupos sobre los valores agregados, se chequea luego de que los grupos son computados. \tn % Row Count 5 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Seguridad}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{En SQL standard se incluyen los privilegios {\bf{SELECT, INSERT, UPDATE,}} y {\bf{DELETE}}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{GRANT}} \textless{}privilege list\textgreater{} on \textless{}relation name or view name\textgreater{} to \textless{}user/role list\textgreater{}; & El comando GRANT es usado para conceder autorización \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} {\bf{REVOKE}} \textless{}privilege list\textgreater{} on \textless{}relation name or view name\textgreater{} from \textless{}user/role list\textgreater{} & La sentencia REVOKE se usa para Para anular una autorización \tn % Row Count 11 (+ 5) % Row 3 \SetRowColor{white} {\bf{CREATE ROLE}} \textless{}rol\_name\textgreater{} & se utiliza para crear un Grupo de privilegios relacionados que se otorgan a usuarios. \tn % Row Count 16 (+ 5) % Row 4 \SetRowColor{LightBackground} {\bf{GRANT}} \textless{}privilege list\textgreater{} on {\emph{table}} to \textless{}rol\_name\textgreater{}; & asignación de privilegios a roles \tn % Row Count 19 (+ 3) % Row 5 \SetRowColor{white} {\bf{GRANT UPDATE }} \textless{}column\_name\textgreater{} on {\emph{table}} to \textless{}rol\_name\textgreater{}; & asignación de privilegio de actualizacion sobre una columna de la tabla a un role \tn % Row Count 24 (+ 5) % Row 6 \SetRowColor{LightBackground} {\bf{GRANT}} \textless{}rol\_name\textgreater{} to \textless{}user\textgreater{}; & asignación de roles a usuarios \tn % Row Count 26 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}