Introduction to My SQL

Introduction to RDBMS: A relational database management system (RDBMS) is a database management system (DBMS) that is based on the r...


Introduction to RDBMS:
  • A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model.
  • RDBMS manages data in “tables” which are also called “relations”.
  • RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
Basic terminology of RDBMS:
  • Database: A repository to store information on a computer. 
  • Table: A table is a collection of related data entries and consists of rows and columns. 
  • Field: Every table is made up of smaller entities called fields. The fields in the Employee table consist of ID, NAME, AGE, ADDRESS and SALARY. 
  • Record: Also called as a row of data, is an individual entry that exists in a table. For example, there are 5 records in the above Employee table. Following is a single row of data or record in the Employee table: 
  • Column: column is a vertical entity in a table that contains all information associated with a specific field in a table. 
  • NULL value: Null value in a table is a field with no value.
SQL Constraints:
  • Constraints are the rules enforced on data columns on the table. These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database. 
  • Constraints could be column level or table level. Column level constraints are applied only to one column whereas table level constraints are applied to the whole table.
Following are commonly used constraints available in SQL:
  • NOT NULL: Constraint: Ensures that a column cannot have a NULL value.
  • DEFAULT: Constraint: Provides a default value for a column when none is specified.
  • UNIQUE: Constraint: Ensures that all values in a column are different.
  • PRIMARY Key: Uniquely identified each row/records in a database table.
  • FOREIGN Key: Uniquely identified a rows/records in any another database table.
  • CHECK Constraint: The CHECK constraint ensures that all values in a column satisfy certain conditions. 
  • INDEX: Use to create and retrieve data from the database very quickly.
SQL Data types:


Commands:

To open MySQL prompt type “Mysql”.
  • Create Database: This statement creates a new, empty database without any tables or data. 
  • Drop Database: This command deletes an existing database
  • Use: The USE statement is used to select an existing database in SQL schema.
  • CREATE TABLE: This command creates a new table. A unique name follows the CREATE TABLE statement which is the table name.
  • INSERT INTO: This command is used to add new rows of data to a table in the database.
  • SELECT: This command is used to fetch the data from a database table which returns data in the form of the result table.











Joins:

There are different types of joins available in SQL:
  • INNER JOIN: returns rows when there is a match in both tables. 
  • LEFT JOIN: returns all rows from the left table, even if there are no matches in the right table. 
  • RIGHT JOIN: returns all rows from the right table, even if there are no matches in the left table. 
  • FULL JOIN: returns rows when there is a match in one of the tables. 
  • SELF JOIN: is used to join a table to itself as if the table were two tables, temporarily renaming at least one table in the SQL statement. 
  • CARTESIAN JOIN: returns the Cartesian product of the sets of records from the two or more joined tables.




COMMENTS

Name

Android,9,Big Data,3,Cloud Apps,1,Database,1,Featured,12,Free Downloads,1,HowTo,1,IOT,7,Java,1,Linux,1,News,6,Products,1,SEO,1,TipsnTricks,5,Ubuntu,1,Unity3D,4,Windows Apps,1,
ltr
item
Tech Geek Bytes - A Blog For News, Tutorials, Free Source Code, Tips and Tricks: Introduction to My SQL
Introduction to My SQL
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPM4wZAVNCAUkL-EAFZ6E-wi18hyXzLSZAr8gDgsdPFGrmS-MJ-gEIGPRuGpOA6By1GciZ0DgMvSEzWkJyoJd-CsrSTWJzkWR8gY31qrAsbK5YRgwAB04OTwJvLvEFtAVGTREos4og38k/s400/mysql-top.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPM4wZAVNCAUkL-EAFZ6E-wi18hyXzLSZAr8gDgsdPFGrmS-MJ-gEIGPRuGpOA6By1GciZ0DgMvSEzWkJyoJd-CsrSTWJzkWR8gY31qrAsbK5YRgwAB04OTwJvLvEFtAVGTREos4og38k/s72-c/mysql-top.png
Tech Geek Bytes - A Blog For News, Tutorials, Free Source Code, Tips and Tricks
https://techgeekbytes.blogspot.com/2017/06/introduction-to-my-sql.html
https://techgeekbytes.blogspot.com/
https://techgeekbytes.blogspot.com/
https://techgeekbytes.blogspot.com/2017/06/introduction-to-my-sql.html
true
8751912191394201619
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy