Types of SQL Commands & Introduction to

Dr. V. V. Subrahmanyam Associate Professor, SOCIS, IGNOU Introduction

provides a concise, formal notation for representating queries. • Commercial systems require a like Structured Query Language (SQL) for querying the data. • It uses a combination of relational algebra and constructs. Background

• In 1970, IBM developed the original version of SQL originally called Sequel as a part of the System R project. • Its name has changed to SQL(structured query language). • Many products now support the SQL language. Versions

• In 1986 the American National Standards Institute (ANSI) and International Organisation for Standardization (ISO) published an SQL standard, called SQL-86. • ANSI published an extended standard for SQL in 1989 namely SQL-89. • The next version is SQL-92 followed by SQL-99 and the recent version is SQL-2003 Types of Commands

• SQL statements are categorized under: – (DDL) – Data Manipulation Language (DML) – Data Control Language (DCL) – Transaction Control Language (TCL) DDL

• It provides commands for defining relational schemas, deleting relations and modifying relational schemas. • They are used to alter/modify a database or structure and schema. • All DDL commands are auto-committed(it saves all the changes permanently in the database) • Examples: – CREATE To create a new table or database – ALTER For altering the table – TRUNCATE Delete data from table – DROP To drop a table – RENAME To rename a table DML

• It includes data manipulation language commands. They affect records in a table. • They are not auto-committed. It means changes are not permanent to database, they can be rolled back. • Examples: – SELECT Retrieve data from a database – INSERT Insert data into a table – UPDATE Update existing data within a table – DELETE Delete records from a table

DCL

• DCL statements control the level of access that users have on database objects. • It includes commands such as Grant etc.. which are mostly concerned with permissions, rights and other controls of Database System • Examples: – GRANT Allow users access privileges to Database – REVOKE To withdraw user access privileges TCL

• TCL statements allow you to control and manage transactions to maintain the integrity of data within SQL statements. • Examples: – BEGIN Transaction Opens a transaction – COMMIT Transaction Commits a transaction – ROLLBACK Transaction ROLLBACK a transaction in case of any error SQL Commands MYSQL

• MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. MySQL is developed, marketed, and supported by MySQL • MySQL is released under an open-source license. So you have nothing to pay to use it. • MySQL is a very powerful program in its own right. It handles a large subset of the functionality of the most expensive and powerful database packages. • MySQL uses a standard form of the well-known SQL data language. Contd… • It works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA, etc. • It works very quickly and works well even with large data sets. • It is very friendly to PHP, the most appreciated language for web development. • It supports large , up to 50 million rows or more in a table. The default file size limit for a table is 4GB, but you can increase this to 8 TB (if your O/S supports and handles) • It is customizable. The open-source GPL license allows programmers to modify the MySQL software to fit their own specific environments.

Characteristics of MySQL

• Scalability and Flexibility • High Performance • High Availability • Robust Transactional Support • Web and DataWarehouse Strengths • Strong Data Protection • Comprehensive Application Development • Opensource • Lowest Total Cost of Ownership

MySQL on Windows

• MySQL provides you with a suite of tools for developing and managing MySQL-based business critical applications on Windows. They include: – MySQL Installer for Windows – MySQL for Excel – MySQL Notifier – MySQL for Visual Studio MySQL Workbench

Contd…

– MySQL Connector/.NET – MYSQL Connector/ODBC – MYSQL Enterprise Edition

MySQL in BigData and IOT

• MySQL is the leading open source database for Web-based and Cloud-based applications; and is integrated within numerous Big Data platforms. • As Big Data and the Internet of Things generate significant transformations in the way organizations capture and analyze new and diverse data streams, find out how using MySQL solutions with Hadoop can enable you to yield more insight than was ever previously imaginable.

MySQL in the Cloud

• From being the leading open-source database for Web-based applications, MySQL has become the leading open-source database in the cloud.