{"id":1112,"date":"2024-07-31T11:15:46","date_gmt":"2024-07-31T09:15:46","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=1112"},"modified":"2024-07-31T11:15:46","modified_gmt":"2024-07-31T09:15:46","slug":"14-atributos-de-los-campos-de-una-tabla","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/databases\/sql\/14-atributos-de-los-campos-de-una-tabla\/","title":{"rendered":"14. Atributos de los campos de una tabla"},"content":{"rendered":"\n<p>Vamos a trabajar con las <strong>tablas,<\/strong> agregando m\u00e1s caracter\u00edsticas a nuestros <strong>atributos,<\/strong> as\u00ed como asignarle una <strong>llave principal<\/strong>. Vamos a <strong>crear<\/strong> una <strong>tabla<\/strong> llamada <em>usuarios,<\/em> que tendr\u00e1 la siguiente sintaxis.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">use curso_sql;\n\ncreate table usuarios (\nusuario_id INT UNSIGNED auto_increment primary KEY,\nnombre VARCHAR(30) not null,\napellidos VARCHAR(50) not null,\nemail VARCHAR(50) unique,\ndireccion VARCHAR(100) default 'Sin direcci\u00f3n',\nedad INT default 0,\n);<\/pre>\n\n\n\n<p>Vamos a ver si se ha creado la tabla con el comando <strong><em>DESCRIBE.<\/em><\/strong><\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DESCRIBE usuarios;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Vamos a trabajar con las tablas, agregando m\u00e1s caracter\u00edsticas a nuestros atributos, as\u00ed como asignarle una llave principal. Vamos a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1076,"menu_order":13,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-1112","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Sutil Web","author_link":"https:\/\/sutilweb.eu\/index.php\/author\/sutilweb\/"},"uagb_comment_info":0,"uagb_excerpt":"Vamos a trabajar con las tablas, agregando m\u00e1s caracter\u00edsticas a nuestros atributos, as\u00ed como asignarle una llave principal. Vamos a [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/comments?post=1112"}],"version-history":[{"count":1,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1112\/revisions"}],"predecessor-version":[{"id":1113,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1112\/revisions\/1113"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1076"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=1112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}