{"id":1752,"date":"2019-12-23T06:33:50","date_gmt":"2019-12-23T06:33:50","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=1752"},"modified":"2019-12-23T09:25:11","modified_gmt":"2019-12-23T09:25:11","slug":"introduction-to-database-concepts","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/","title":{"rendered":"Introduction to Database Concepts"},"content":{"rendered":"<h2>DBMS and SQL<\/h2>\n<p>A Database Management System (DBMS), is a software program that enables the users to access database, manipulate data and represent it.  SQL (Structured Query Language) is one of the RDBMS examples. SQL divides its commands on the basis of functionalities performed by them<\/p>\n<h3>The main types of commands in SQL are:<\/h3>\n<ol>\n<li>\nDDL (Data Definition Language) &#8211; DDL manages table and index structure. The most basic commands of DDL are create, alter, rename and drop statements.<\/p>\n<ul>\n<li>\nCreate &#8211; create an object in the database.<br \/>\nSyntax:-<code><br \/>\nCREATE TABLE table_name (<br \/>\n\tcolumn1 datatype,<br \/>\n\tcolumn2 datatype,<br \/>\n\tcolumn3 datatype,<br \/>\n   ....<br \/>\n);<br \/>\n<\/code>\n<\/li>\n<li>\nDrop &#8211; delete an object (table) in the database.<br \/>\nSyntax:-<br \/>\n<code>DROP TABLE table_name;<\/code>\n<\/li>\n<li>\nAlter &#8211; modify the structure of an existing object in the <a href=\"https:\/\/www.studysection.com\/mysql-foundation\">database<\/a>.<br \/>\nSyntax:-<code><br \/>\nALTER TABLE table_name<br \/>\nADD column_name datatype;<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<\/li>\n<li>\nDML (Data Manipulation Language)  &#8211;  DML is a subset of SQL used to add, update, and delete the data. They are the queries that modify data. The most basic commands of DML are Insert, Select, Update, Delete.<\/p>\n<ul>\n<li>\nINSERT &#8211;<br \/>\nInsert statement is used to insert data into an existing table. The Insert<br \/>\nstatement has the following format<br \/>\nSyntax:-<code><br \/>\nINSERT INTO table_name (column1, column2, column3,...)<br \/>\nVALUES (value1, value2, value3, ...);<br \/>\n<\/code>\n<\/li>\n<li>\nSELECT &#8211;<br \/>\nThe SELECT statement is used for retrieving the data stored in a single table or in multiple related tables. Select has three main keywords: SELECT, FROM and WHERE. The SELECT list is the list of columns (from one or multiple tables) or computed values that are to be retrieved from the query. The FROM statement specifies the table, tables, or views from which you want to fetch the data. The WHERE clause specifies a condition to include or exclude rows for the query\u2019s output.<br \/>\nSyntax:-<code><br \/>\nSELECT column1, column2,<br \/>\nFROM table_name;<br \/>\n<\/code><br \/>\nHere, column1 and column2 are the field names of the table from where you want to select data. If you want to select all the fields which are available in the table, use the following syntax:<code><br \/>\nSELECT * FROM table_name;<br \/>\n<\/code>\n<\/li>\n<li>\nUPDATE &#8211;<br \/>\nThe update statement is used to modify the table data.<br \/>\nSyntax:-<code><br \/>\nUPDATE table_name<br \/>\nSET column1 = value1, column2 = value2, ...<br \/>\nWHERE condition;<br \/>\n<\/code>\n<\/li>\n<li>\nDELETE &#8211;<br \/>\nThe delete statement is used to remove records permanently from a table.<br \/>\nSyntax:-<code><br \/>\nDELETE FROM table_name WHERE condition;<br \/>\n<\/code>\n<\/li>\n<li>\nTRUNCATE &#8211;<br \/>\nThe truncate statement removes all records from a table. It executes faster than a DELETE statement without a WHERE clause. TRUNCATE statement retains the structure of the table. It will also reinitialize the identity columns to the specified initial value. It looks like this:<code><br \/>\nTRUNCATE TABLE table_name;<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Constraints In SQL-<\/h3>\n<p>Constraints are the conditions used to limit or control the type or values of data that the user can enter into the tables. The main categories of constraints are:-<\/p>\n<ol>\n<li>Primary key constraints.<\/li>\n<li>Foreign key constraints.<\/li>\n<li>Default constraints.<\/li>\n<li>Not null constraints.<\/li>\n<li>Check constraints.<\/li>\n<li>Unique constraints.<\/li>\n<\/ol>\n<ul>\n<li>Primary key constraints:-<br \/>\nA Primary key constraint is a column or a set of columns that uniquely identify a row in the table. Although you can assign more than one field as the primary key, each table can have only one primary key. A primary key column value must be unique and not null.<\/li>\n<li>Foreign key constraints:-<br \/>\nA foreign key constraint consists of a column or a set of columns that is related to column\/s of a primary key table. It can be one to one or one to many relationships. The primary key is on one side of the relationship, whereas the foreign key is on the many sides of the relationship. It is possible to have multiple foreign keys in a table. Each foreign key relates to a primary key in another table. While adding records in a table with a foreign key, the value must be present in the related table with a primary key.<\/li>\n<li>Default constraints:-<br \/>\nA default constraint is a default value that SQL Server automatically places in a particular field in a table. A default value can be constant, NULL, or a function. All fields except identity and time stamp fields can contain default values. Each column can have one default constraint.<\/li>\n<li>Not Null Constraints:-<br \/>\nIn certain situations, data in a field is required for example a father\u2019s name is compulsory. The Not Null constraint enables you to accomplish this task.<\/li>\n<li>Check Constraints:-<br \/>\nCheck constraints can be used to limit the range of values that a user can enter into a column. Multiple Check constraints are allowed for a particular column.<\/li>\n<li>Unique Constraints:-<br \/>\nA unique constraint requires that each entry in a particular column is unique. A unique constraint is created by creating a unique index. The UNIQUE constraint identifies each record in a <a href=\"https:\/\/studysection.com\/blog\/database-testing-using-selenium\/\">database table<\/a>. The difference between UNIQUE constraint and PRIMARY Key is that unique columns can contain null whereas the primary key column is not null. There can be only one primary key in a table but multiple unique keys are allowed in the table.<\/li>\n<\/ul>\n<p><small><em>PHP programming is a valuable skill that a programmer can have. Let StudySection help you out with proving your programming skills through its <a href=\"https:\/\/www.studysection.com\/php-web-development-advanced\">PHP certification<\/a>. StudySection provides beginner as well as expert-level certifications in PHP programming to prove your level of skills in PHP programming.<\/em><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DBMS and SQL A Database Management System (DBMS), is a software program that enables the users to access database, manipulate<\/p>\n","protected":false},"author":1,"featured_media":1753,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[149,309,308,99,307,306],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>StudySection Blog - Introduction to Database Concepts<\/title>\n<meta name=\"description\" content=\"A Database Management System (DBMS), is a software program that enables the users to access database, manipulate data and represent it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"StudySection Blog - Introduction to Database Concepts\" \/>\n<meta property=\"og:description\" content=\"A Database Management System (DBMS), is a software program that enables the users to access database, manipulate data and represent it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-23T06:33:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-23T09:25:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/12\/database.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"Introduction to Database Concepts\",\"datePublished\":\"2019-12-23T06:33:50+00:00\",\"dateModified\":\"2019-12-23T09:25:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/\"},\"wordCount\":822,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"database\",\"ddl\",\"dml\",\"management\",\"RDBMS\",\"SQL\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/\",\"url\":\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/\",\"name\":\"StudySection Blog - Introduction to Database Concepts\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2019-12-23T06:33:50+00:00\",\"dateModified\":\"2019-12-23T09:25:11+00:00\",\"description\":\"A Database Management System (DBMS), is a software program that enables the users to access database, manipulate data and represent it.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to Database Concepts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"StudySection Blog - Introduction to Database Concepts","description":"A Database Management System (DBMS), is a software program that enables the users to access database, manipulate data and represent it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/","og_locale":"en_US","og_type":"article","og_title":"StudySection Blog - Introduction to Database Concepts","og_description":"A Database Management System (DBMS), is a software program that enables the users to access database, manipulate data and represent it.","og_url":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2019-12-23T06:33:50+00:00","article_modified_time":"2019-12-23T09:25:11+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/12\/database.png","type":"image\/png"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"Introduction to Database Concepts","datePublished":"2019-12-23T06:33:50+00:00","dateModified":"2019-12-23T09:25:11+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/"},"wordCount":822,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["database","ddl","dml","management","RDBMS","SQL"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/","url":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/","name":"StudySection Blog - Introduction to Database Concepts","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2019-12-23T06:33:50+00:00","dateModified":"2019-12-23T09:25:11+00:00","description":"A Database Management System (DBMS), is a software program that enables the users to access database, manipulate data and represent it.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/introduction-to-database-concepts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Introduction to Database Concepts"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":596,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1752"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=1752"}],"version-history":[{"count":6,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1752\/revisions"}],"predecessor-version":[{"id":1759,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1752\/revisions\/1759"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/1753"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=1752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=1752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=1752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}