The document discusses Structured Query Language (SQL) and provides information about SQL, MySQL, and database commands in MySQL. Specifically, it defines SQL, describes its origins and advantages, lists some database management systems that use SQL, and discusses MySQL features and commands for creating, manipulating, and querying databases and tables. These include commands for data definition, data manipulation, data control, transactions, and altering tables by adding, modifying or dropping columns and constraints.
SQL is a standard language used to access and manage relational database systems. It was originally developed in the 1970s at IBM for use in database management systems. Some popular database systems that support SQL include MySQL, PostgreSQL, Oracle, SQLite, and Microsoft SQL Server. SQL allows users to define and manipulate the structure and data of databases through commands like SELECT, INSERT, UPDATE, DELETE, and more.
The document provides information about Structured Query Language (SQL) and its use for accessing and modifying relational databases. It discusses how SQL was originally developed at IBM in the 1970s and is now used by many database management systems like MySQL, PostgreSQL, Oracle, SQLite, and Microsoft SQL Server. The document also provides some key advantages of using SQL and describes common SQL commands for managing databases and querying data.
SQL is a programming language used to define, manipulate, and retrieve data from relational databases. It includes commands for data definition, manipulation, and retrieval. XAMPP is a free and easy to install package containing Apache, MariaDB, PHP, and Perl. It provides a local development environment for testing databases, servers, and web applications. The document provides examples of SQL commands for creating databases and tables, inserting, updating, and deleting data, and retrieving data using select statements.
SQL is a programming language used to define, manipulate, and retrieve data from relational databases. It includes commands for data definition, manipulation, and retrieval. XAMPP is a free and easy to install package containing Apache, MariaDB, PHP, and Perl. It provides a local development environment for testing databases, servers, and web applications. The document provides examples of SQL commands for creating databases and tables, inserting, updating, and deleting data, and retrieving data using select statements.
The document discusses various components and concepts related to database management systems (DBMS). It defines a database as a collection of related data organized for easy access, management, and updating. It describes the main components of a DBMS as hardware, software, data, procedures, and database access language. It also discusses key DBMS concepts like data definition language, data manipulation language, functions, constraints, and having clause.
The document provides an introduction to MySQL and relational database management systems. It discusses what a database and RDBMS are, common RDBMS terminology like tables, columns, rows, keys, and indexes. It also covers how to install and use MySQL, including creating databases and tables, and performing basic CRUD (create, read, update, delete) operations using SQL statements. The document is aimed at getting readers started with the MySQL database system.
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
This document provides an introduction and overview of SQL and database concepts for a BAIS 3rd Year database systems lab class using MySQL 5.5. It introduces SQL, its functions and commands including DDL, DML, DQL, and TCL. Examples are provided for creating tables, inserting, updating, deleting and querying data, as well as using transactions with commit and rollback. The document is intended to teach students key SQL concepts and skills for working with databases.
This document provides an overview of MySQL, including its features, types of SQL commands, data types, and how to create and manage databases and tables. It discusses how to create databases and tables, insert, delete, and modify records, and make simple queries. The objective is to introduce MySQL and SQL, explain the different types of SQL commands, and demonstrate how to handle databases and tables through examples.
SQL is a standard language used to access and manage relational database systems. It was originally developed in the 1970s at IBM for use in database management systems. Some popular database systems that support SQL include MySQL, PostgreSQL, Oracle, SQLite, and Microsoft SQL Server. SQL allows users to define and manipulate the structure and data of databases through commands like SELECT, INSERT, UPDATE, DELETE, and more.
The document provides information about Structured Query Language (SQL) and its use for accessing and modifying relational databases. It discusses how SQL was originally developed at IBM in the 1970s and is now used by many database management systems like MySQL, PostgreSQL, Oracle, SQLite, and Microsoft SQL Server. The document also provides some key advantages of using SQL and describes common SQL commands for managing databases and querying data.
SQL is a programming language used to define, manipulate, and retrieve data from relational databases. It includes commands for data definition, manipulation, and retrieval. XAMPP is a free and easy to install package containing Apache, MariaDB, PHP, and Perl. It provides a local development environment for testing databases, servers, and web applications. The document provides examples of SQL commands for creating databases and tables, inserting, updating, and deleting data, and retrieving data using select statements.
SQL is a programming language used to define, manipulate, and retrieve data from relational databases. It includes commands for data definition, manipulation, and retrieval. XAMPP is a free and easy to install package containing Apache, MariaDB, PHP, and Perl. It provides a local development environment for testing databases, servers, and web applications. The document provides examples of SQL commands for creating databases and tables, inserting, updating, and deleting data, and retrieving data using select statements.
The document discusses various components and concepts related to database management systems (DBMS). It defines a database as a collection of related data organized for easy access, management, and updating. It describes the main components of a DBMS as hardware, software, data, procedures, and database access language. It also discusses key DBMS concepts like data definition language, data manipulation language, functions, constraints, and having clause.
The document provides an introduction to MySQL and relational database management systems. It discusses what a database and RDBMS are, common RDBMS terminology like tables, columns, rows, keys, and indexes. It also covers how to install and use MySQL, including creating databases and tables, and performing basic CRUD (create, read, update, delete) operations using SQL statements. The document is aimed at getting readers started with the MySQL database system.
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
This document provides an introduction and overview of SQL and database concepts for a BAIS 3rd Year database systems lab class using MySQL 5.5. It introduces SQL, its functions and commands including DDL, DML, DQL, and TCL. Examples are provided for creating tables, inserting, updating, deleting and querying data, as well as using transactions with commit and rollback. The document is intended to teach students key SQL concepts and skills for working with databases.
This document provides an overview of MySQL, including its features, types of SQL commands, data types, and how to create and manage databases and tables. It discusses how to create databases and tables, insert, delete, and modify records, and make simple queries. The objective is to introduce MySQL and SQL, explain the different types of SQL commands, and demonstrate how to handle databases and tables through examples.
This document provides an introduction and overview of SQL and database systems for a BAIS 3rd year class in 2015. It covers topics such as what SQL is, the functions and commands of SQL like SELECT, INSERT, UPDATE and DELETE. It also discusses database objects like tables, records, fields and columns. Specific SQL commands are defined for manipulating and querying database tables, including DDL, DML, DQL, DCL and TCL commands. Examples are provided for creating tables and inserting, updating and deleting records in MySQL.
This document provides an outline of a SQL Lab tutorial covering MySQL. It introduces SQL and connecting to MySQL. It then covers various MySQL commands including administration commands, data definition language commands to create/drop databases and tables, data manipulation language commands to insert, retrieve, update and delete records, and more advanced queries using concepts like joins, aggregation, and pattern matching. SQL is introduced as a standard language for accessing and manipulating database systems and working with different database programs.
This document provides information about MySQL, including that it is a popular open source database that is ideal for both small and large applications. It notes that Facebook and other large companies use MySQL and have contributed to WebScaleSQL, a collaboration to improve MySQL performance for large-scale use. The document then gives examples of common MySQL operations like connecting, managing databases and tables, inserting/updating/deleting data, and more.
MySQL is an open-source relational database management system that runs a server providing multi-user access to databases. It is commonly used with web applications and is popular for its use with PHP. Many large websites use MySQL to store user data. MySQL supports basic queries like SELECT, INSERT, UPDATE, and DELETE to retrieve, add, modify and remove data from databases. It also supports more advanced functions and queries.
SQL is a language used to store, retrieve, and manage data in relational database management systems. It contains commands like SELECT, INSERT, UPDATE, DELETE to query and manipulate data. SQL also allows functions, operators, transactions, and other capabilities to ensure data integrity and security. Integrity constraints like primary keys and foreign keys help maintain relational integrity between tables.
- A database is an organized collection of data stored together to serve applications. Most databases store data in tables which can be managed using RDBMS software like MySQL.
- MySQL is an open source and free RDBMS that uses SQL and allows storing, modifying, and querying data across various platforms. It provides features like security, connectivity, and transaction control.
- SQL commands allow defining the database structure using DDL, manipulating data using DML, and controlling transactions with TCL. Common queries include SELECT, INSERT, UPDATE, DELETE. Functions and clauses like WHERE, ORDER BY, GROUP BY etc. filter and organize query results.
MySQL is an open-source relational database management system that runs on a server and allows for multi-user access to databases. It is commonly used with web applications and by popular websites. MySQL uses commands like SELECT, INSERT, UPDATE, and DELETE to retrieve, add, modify and remove data from databases. It also supports stored procedures and functions to organize more complex queries and calculations.
This document provides a summary of the MySQL reference manual. It discusses that MySQL is a fast, multi-threaded SQL database server that runs on Unix, OS/2 and Windows platforms. It provides licensing information and points to sections that cover features, installation, upgrading, tutorials, examples and more. It also lists contributors and provides contact information for submitting bugs and suggestions.
MySQL is an open-source relational database management system. The document discusses the introduction to MySQL, its development history, installation, features, data types, basic commands like CREATE, SELECT, UPDATE, DELETE. It also covers MySQL constraints. MySQL is widely used for web applications due to its speed, ease of use and open source nature. It can store and manage large volumes of data across different tables using relationships.
SQL (Structured Query Language) is a programming language which is used to manage data stored in relational databases like MySQL, MS Access, SQL Server, Oracle, Sybase, Informix, Postgres etc.
MySQL is an open-source relational database management system that is free, fast, reliable, and scalable. It was first released in 1995 and is now developed by Oracle Corporation. MySQL allows users to perform operations like selecting, inserting, updating, and deleting data. It also supports creating databases and tables, adding/dropping columns, and joining tables together to query related data.
MySQL is an open-source relational database management system. The document discusses MySQL including its introduction, development history, installation, features, data types, basic commands like CREATE, SELECT, UPDATE, DELETE. It also covers MySQL constraints. Key points include that MySQL is popular, free, works with many operating systems, supports SQL, and is used by many large websites. It provides details on installing and using basic functions of MySQL.
This document provides an overview of connecting to and interacting with MySQL databases from PHP. It covers connecting to MySQL, selecting databases, executing SQL statements, and retrieving and manipulating data. Key topics include using mysql_connect() to open connections, mysql_query() to execute queries, and functions like mysql_fetch_array() to retrieve result sets. Error handling and security best practices are also discussed.
This document describes various database objects like sequences, indexes, and synonyms. It explains that sequences are used to automatically generate primary keys and improve efficiency. Indexes speed up queries by indexing columns frequently used in WHERE clauses. Synonyms provide alternative names for objects to simplify access. The document provides examples of creating, modifying, viewing, and dropping these database objects using SQL statements.
SQLite is available on every Android device. Using an SQLite database in Android does not require any database setup or administration. You only have to define the SQL statements for creating and updating the database. Afterwards the database is automatically managed for you by the Android platform. In this chapter we will discuss about developing application with SQLite.
This document discusses MySQL databases and how to interact with them using PHP. It begins by introducing MySQL as the world's most popular open source database and describes some basic database server concepts. It then provides code examples for how to connect to a MySQL database from PHP, select a database, perform queries to read, insert, update, and delete records, and more. The document is intended as a tutorial for learning the basic functions and syntax for accessing and manipulating data in a MySQL database with PHP.
This document provides instructions and examples for using the MySQL database system. It discusses MySQL concepts like database, tables, rows, and columns. It also demonstrates common SQL commands like CREATE, SELECT, INSERT, UPDATE, DROP. Examples show how to create databases and tables, insert data, query data, and more. Installation and configuration steps are also covered.
This document provides instructions and examples for using the MySQL database system. It discusses MySQL concepts like database, tables, rows, and columns. It also demonstrates common SQL commands like CREATE, SELECT, INSERT, UPDATE, DROP. Examples show how to create databases and tables, insert and query data, use functions, conditions and wildcards. Script files demonstrate populating tables with sample data.
A neural network is a machine learning program, or model, that makes decisions in a manner similar to the human brain, by using processes that mimic the way biological neurons work together to identify phenomena, weigh options and arrive at conclusions.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
This document provides an introduction and overview of SQL and database systems for a BAIS 3rd year class in 2015. It covers topics such as what SQL is, the functions and commands of SQL like SELECT, INSERT, UPDATE and DELETE. It also discusses database objects like tables, records, fields and columns. Specific SQL commands are defined for manipulating and querying database tables, including DDL, DML, DQL, DCL and TCL commands. Examples are provided for creating tables and inserting, updating and deleting records in MySQL.
This document provides an outline of a SQL Lab tutorial covering MySQL. It introduces SQL and connecting to MySQL. It then covers various MySQL commands including administration commands, data definition language commands to create/drop databases and tables, data manipulation language commands to insert, retrieve, update and delete records, and more advanced queries using concepts like joins, aggregation, and pattern matching. SQL is introduced as a standard language for accessing and manipulating database systems and working with different database programs.
This document provides information about MySQL, including that it is a popular open source database that is ideal for both small and large applications. It notes that Facebook and other large companies use MySQL and have contributed to WebScaleSQL, a collaboration to improve MySQL performance for large-scale use. The document then gives examples of common MySQL operations like connecting, managing databases and tables, inserting/updating/deleting data, and more.
MySQL is an open-source relational database management system that runs a server providing multi-user access to databases. It is commonly used with web applications and is popular for its use with PHP. Many large websites use MySQL to store user data. MySQL supports basic queries like SELECT, INSERT, UPDATE, and DELETE to retrieve, add, modify and remove data from databases. It also supports more advanced functions and queries.
SQL is a language used to store, retrieve, and manage data in relational database management systems. It contains commands like SELECT, INSERT, UPDATE, DELETE to query and manipulate data. SQL also allows functions, operators, transactions, and other capabilities to ensure data integrity and security. Integrity constraints like primary keys and foreign keys help maintain relational integrity between tables.
- A database is an organized collection of data stored together to serve applications. Most databases store data in tables which can be managed using RDBMS software like MySQL.
- MySQL is an open source and free RDBMS that uses SQL and allows storing, modifying, and querying data across various platforms. It provides features like security, connectivity, and transaction control.
- SQL commands allow defining the database structure using DDL, manipulating data using DML, and controlling transactions with TCL. Common queries include SELECT, INSERT, UPDATE, DELETE. Functions and clauses like WHERE, ORDER BY, GROUP BY etc. filter and organize query results.
MySQL is an open-source relational database management system that runs on a server and allows for multi-user access to databases. It is commonly used with web applications and by popular websites. MySQL uses commands like SELECT, INSERT, UPDATE, and DELETE to retrieve, add, modify and remove data from databases. It also supports stored procedures and functions to organize more complex queries and calculations.
This document provides a summary of the MySQL reference manual. It discusses that MySQL is a fast, multi-threaded SQL database server that runs on Unix, OS/2 and Windows platforms. It provides licensing information and points to sections that cover features, installation, upgrading, tutorials, examples and more. It also lists contributors and provides contact information for submitting bugs and suggestions.
MySQL is an open-source relational database management system. The document discusses the introduction to MySQL, its development history, installation, features, data types, basic commands like CREATE, SELECT, UPDATE, DELETE. It also covers MySQL constraints. MySQL is widely used for web applications due to its speed, ease of use and open source nature. It can store and manage large volumes of data across different tables using relationships.
SQL (Structured Query Language) is a programming language which is used to manage data stored in relational databases like MySQL, MS Access, SQL Server, Oracle, Sybase, Informix, Postgres etc.
MySQL is an open-source relational database management system that is free, fast, reliable, and scalable. It was first released in 1995 and is now developed by Oracle Corporation. MySQL allows users to perform operations like selecting, inserting, updating, and deleting data. It also supports creating databases and tables, adding/dropping columns, and joining tables together to query related data.
MySQL is an open-source relational database management system. The document discusses MySQL including its introduction, development history, installation, features, data types, basic commands like CREATE, SELECT, UPDATE, DELETE. It also covers MySQL constraints. Key points include that MySQL is popular, free, works with many operating systems, supports SQL, and is used by many large websites. It provides details on installing and using basic functions of MySQL.
This document provides an overview of connecting to and interacting with MySQL databases from PHP. It covers connecting to MySQL, selecting databases, executing SQL statements, and retrieving and manipulating data. Key topics include using mysql_connect() to open connections, mysql_query() to execute queries, and functions like mysql_fetch_array() to retrieve result sets. Error handling and security best practices are also discussed.
This document describes various database objects like sequences, indexes, and synonyms. It explains that sequences are used to automatically generate primary keys and improve efficiency. Indexes speed up queries by indexing columns frequently used in WHERE clauses. Synonyms provide alternative names for objects to simplify access. The document provides examples of creating, modifying, viewing, and dropping these database objects using SQL statements.
SQLite is available on every Android device. Using an SQLite database in Android does not require any database setup or administration. You only have to define the SQL statements for creating and updating the database. Afterwards the database is automatically managed for you by the Android platform. In this chapter we will discuss about developing application with SQLite.
This document discusses MySQL databases and how to interact with them using PHP. It begins by introducing MySQL as the world's most popular open source database and describes some basic database server concepts. It then provides code examples for how to connect to a MySQL database from PHP, select a database, perform queries to read, insert, update, and delete records, and more. The document is intended as a tutorial for learning the basic functions and syntax for accessing and manipulating data in a MySQL database with PHP.
This document provides instructions and examples for using the MySQL database system. It discusses MySQL concepts like database, tables, rows, and columns. It also demonstrates common SQL commands like CREATE, SELECT, INSERT, UPDATE, DROP. Examples show how to create databases and tables, insert data, query data, and more. Installation and configuration steps are also covered.
This document provides instructions and examples for using the MySQL database system. It discusses MySQL concepts like database, tables, rows, and columns. It also demonstrates common SQL commands like CREATE, SELECT, INSERT, UPDATE, DROP. Examples show how to create databases and tables, insert and query data, use functions, conditions and wildcards. Script files demonstrate populating tables with sample data.
A neural network is a machine learning program, or model, that makes decisions in a manner similar to the human brain, by using processes that mimic the way biological neurons work together to identify phenomena, weigh options and arrive at conclusions.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISTier1 app
Are you ready to unlock the secrets hidden within Java thread dumps? Join us for a hands-on session where we'll delve into effective troubleshooting patterns to swiftly identify the root causes of production problems. Discover the right tools, techniques, and best practices while exploring *real-world case studies of major outages* in Fortune 500 enterprises. Engage in interactive lab exercises where you'll have the opportunity to troubleshoot thread dumps and uncover performance issues firsthand. Join us and become a master of Java thread dump analysis!
Orca: Nocode Graphical Editor for Container OrchestrationPedro J. Molina
Tool demo on CEDI/SISTEDES/JISBD2024 at A Coruña, Spain. 2024.06.18
"Orca: Nocode Graphical Editor for Container Orchestration"
by Pedro J. Molina PhD. from Metadev
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...Luigi Fugaro
Vector databases are transforming how we handle data, allowing us to search through text, images, and audio by converting them into vectors. Today, we'll dive into the basics of this exciting technology and discuss its potential to revolutionize our next-generation AI applications. We'll examine typical uses for these databases and the essential tools
developers need. Plus, we'll zoom in on the advanced capabilities of vector search and semantic caching in Java, showcasing these through a live demo with Redis libraries. Get ready to see how these powerful tools can change the game!
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...kalichargn70th171
Visual testing plays a vital role in ensuring that software products meet the aesthetic requirements specified by clients in functional and non-functional specifications. In today's highly competitive digital landscape, users expect a seamless and visually appealing online experience. Visual testing, also known as automated UI testing or visual regression testing, verifies the accuracy of the visual elements that users interact with.
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...kalichargn70th171
In today's fiercely competitive mobile app market, the role of the QA team is pivotal for continuous improvement and sustained success. Effective testing strategies are essential to navigate the challenges confidently and precisely. Ensuring the perfection of mobile apps before they reach end-users requires thoughtful decisions in the testing plan.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
React.js, a JavaScript library developed by Facebook, has gained immense popularity for building user interfaces, especially for single-page applications. Over the years, React has evolved and expanded its capabilities, becoming a preferred choice for mobile app development. This article will explore why React.js is an excellent choice for the Best Mobile App development company in Noida.
Visit Us For Information: https://www.linkedin.com/pulse/what-makes-reactjs-stand-out-mobile-app-development-rajesh-rai-pihvf/
Mobile App Development Company In Noida | Drona Infotech
sql.pdf
1. Computer Science
Class XII ( As per CBSE Board)
Chapter 11
Structured
Query
Language
New
syllabus
2020-21
Visit : python.mykvs.in for regular updates
2. SQL
SQL is an acronym of Structured Query Language.It is a
standard language developed and used for accessing and
modifying relational databases.
The SQL language was originally developed at the IBM research
laboratory in San José, in connection with a project developing
a prototype for a relational database management system
called System R in the early 70s.
SQL is being used by many database management systems.
Some of them are:
MySQL
PostgreSQL
Oracle
SQLite
Microsoft SQL Server
Visit : python.mykvs.in for regular updates
3. Advantages of using SQL
Interactive Language-This language can be used for
communicating with the databases and receive answers to the
complex questions in seconds.
Multiple data views-The users can make different views of
database structure and databases for the different users.
Portability-SQL can be used in the program in PCs, servers,
laptops, and even some of the mobile phones and even on
different dbms softwares
No coding needed-It is very easy to manage the database
systems without any need to write the substantial amount of
code by using the standard SQL.
Well defined standards-Long established are used by the SQL
databases that is being used by ISO and ANSI. There are no
standards adhered by the non-SQL databases.
SQL
Visit : python.mykvs.in for regular updates
4. MySQL is currently the most popular open source
database software. It is a multi-user, multithreaded
database management system. MySQL is especially
popular on the web. It is one of the parts of the very
popular LAMP platform. Linux, Apache, MySQL and PHP
or WIMP platform Windows,Apache,MySQL and PHP.
MySQL AB was founded by Michael Widenius (Monty),
David Axmark and Allan Larsson in Sweden in year 1995.
SQL
Visit : python.mykvs.in for regular updates
5. MySQL Features
Open Source & Free of Cost:
It is Open Source and available at free of cost.
Portability:
Small enough in size to instal and run it on any types of Hardware and
OS like Linux,MS Windows or Mac etc.
Security :
Its Databases are secured & protected with password.
Connectivity
Various APIs are developed to connect it with many programming
languages.
Query Language
It supports SQL (Structured Query Language) for handling database.
SQL
Visit : python.mykvs.in for regular updates
6. Types of SQL Commands
DDL (Data Definition Language)
To create database and table structure-commands
like CREATE , ALTER , DROP etc.
DML (Data Manipulation Language)
Record/rows related operations.commands like
SELECT...., INSERT..., DELETE..., UPDATE.... etc.
DCL (Data Control Language)
used to manipulate permissions or access rights to the
tables. commands like GRANT , REVOKE etc.
Transactional control Language.
Used to control the transactions.commands like
COMMIT, ROLLBACK, SAVEPOINT etc.
SQL
Visit : python.mykvs.in for regular updates
7. Data type in MySQL
Numeric Data Types:
INTEGER or INT – up to 11 digit number without decimal.
SMALLINT – up to 5 digit number without decimal.
FLOAT (M,D) or DECIMAL(M,D) or NUMERIC(M,D)
Stores Real numbers upto M digit length (including .) with D
decimal places.
e.g. Float (10,2) can store 1234567.89
Date & Time Data Types:
DATE - Stores date in YYYY-MM-DD format.
TIME - Stores time in HH:MM:SS format.
String or Text Data Type:
CHAR(Size)
A fixed length string up to 255 characters. (default is 1)
VARCHAR(Size)
A variable length string up to 255 characters.
Char, Varchar, Date and Time values should be enclosed with single (‘ ‘) or double (
“”) quotes in MySQL. varchar is used in MySQL and varchar2 is used in Oracle.
SQL
Visit : python.mykvs.in for regular updates
8. Database Commands in MySql
Getting listings of available databases
mysql> SHOW DATABASES;
Creating a database-
mysql> CREATE database myschool;
Deleting a database mysql> DROP database <databasename>;
to remove table mysql> drop table <tablename>;
After database creation we can open the database using USE command
mysql> USE myschool;
To show list of tables in opened database
mysql> SHOW TABLES;
Creating a table in the database is achieved with CREATE table statement.
mysql> CREATE TABLE student (lastname varchar(15),firstname varchar(15), city
varchar(20), class char(2));
The command DESCRIBE is used to view the structure of a table.
mysql> DESCRIBE student;
SQL
Visit : python.mykvs.in for regular updates
9. Database Commands in MySql
To insert new rows into an existing table use the INSERT command:
mysql>INSERT INTO student values(‘dwivedi’,’freya’,’Udaipur’,’4’);
We can insert record with specific column only
mysql>INSERT INTO student(lastname,firstname,city) values(‘dwivedi’,’Mohak’,’Udaipur’,);
With the SELECT command we can retrieve previously inserted rows:
A general form of SELECT is:
SELECT what to select(field name) FROM table(s)
WHERE condition that the data must satisfy;
• Comparison operators are: < ; <= ; = ; != or <> ; >= ; >
• Logical operators are: AND ; OR ; NOT
• Comparison operator for special value NULL: IS
mysql> SELECT * FROM student;
SQL
Visit : python.mykvs.in for regular updates
10. Database Commands in MySql
Selecting rows by using the WHERE clause in the SELECT command
mysql> SELECT * FROM student WHERE class=“4";
Selecting specific columns(Projection) by listing their names
mysql> SELECT first_name, class FROM student;
Selecting rows with null values in specific column
mysql> SELECT * FROM Student WHERE City IS NULL ;
BETWEEN- to access data in specified range
mysql> SELECT * FROM Student WHERE class between 4 and 6;
IN- operator allows us to easily test if the expression in the list of values.
mysql> SELECT * FROM Student WHERE class in (4,5,6);
SQL
Visit : python.mykvs.in for regular updates
11. Database Commands in MySql
Pattern Matching – LIKE Operator
A string pattern can be used in SQL using the following wild card
% Represents a substring in any length
_ Represents a single character
Example:
‘A%’ represents any string starting with ‘A’ character.
‘_ _A’ represents any 3 character string ending with ‘A’.
‘_B%’ represents any string having second character ‘B’
‘_ _ _’ represents any 3 letter string.
A pattern is case sensitive and can be used with LIKE operator.
mysql> SELECT * FROM Student WHERE Name LIKE ‘A%’;
mysql> SELECT * FROM Student WHERE Name LIKE ’%Singh%’;
mysql> SELECT Name, City FROM Student WHERE Class>=8 AND Name LIKE
‘%Kumar%’ ;
SQL
Visit : python.mykvs.in for regular updates
12. Database Commands in MySql
mysql> SELECT * FROM Student ORDER BY class;
To get descending order use DESC key word.
mysql> SELECT * FROM Student ORDER BY class DESC;
To display data after removal of duplicate values from specific column.
mysql> select distinct class from student;
Deleting selected rows from a table using the DELETE command
mysql> DELETE FROM student WHERE firstname=“amar";
To modify or update entries in the table use the UPDATE command
mysql> UPDATE student SET class=“V" WHERE firstname=“freya";
SQL
Visit : python.mykvs.in for regular updates
13. Database Commands in MySql
Creating Table with Constraints
The following constraints are commonly used in SQL:
NOT NULL -It Ensures that a column cannot have a NULL value
UNIQUE - It Ensures that all values in a column are different
PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely
identifies each row in a table
FOREIGN KEY - It Uniquely identifies a row/record in another table
CHECK - It Ensures that all values in a column satisfies a specific
condition
DEFAULT - It Sets a default value for a column when no value is specified
INDEX - It is Used to create and retrieve data from the database very
quickly
SQL
Visit : python.mykvs.in for regular updates
14. Database Commands in MySql
Creating Table with Constraints
mysql> CREATE TABLE Persons (
ID int NOT NULL PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
City varchar(255) DEFAULT ‘Jaipur',
CONSTRAINT CHK_Person CHECK (Age>=18)
);
mysql> CREATE TABLE Orders (
OrderID int NOT NULL,
OrderNumber int NOT NULL,
PersonID int,
PRIMARY KEY (OrderID),
FOREIGN KEY (PersonID) REFERENCES Persons(ID) );
SQL
Visit : python.mykvs.in for regular updates
15. Database Commands in MySql
Altering Table
The SQL ALTER TABLE command is used to add, delete or modify
columns in an existing table. You should also use the ALTER TABLE
command to add and drop various constraints on an existing table.
Syntax
The basic syntax of an ALTER TABLE command to add a New Column in
an existing table is as follows.
ALTER TABLE table_name ADD column_name datatype;
The basic syntax of an ALTER TABLE command to DROP COLUMN in an
existing table is as follows.
ALTER TABLE table_name DROP COLUMN column_name;
The basic syntax of an ALTER TABLE command to change the DATA TYPE
of a column in a table is as follows.
ALTER TABLE table_name MODIFY COLUMN column_name datatype;
SQL
Visit : python.mykvs.in for regular updates
16. Database Commands in MySql
Altering Table
The basic syntax of an ALTER TABLE command to add a NOT NULL constraint to a column in a table
is as follows.
ALTER TABLE table_name MODIFY column_name datatype NOT NULL;
The basic syntax of ALTER TABLE to ADD UNIQUE CONSTRAINT to a table is as follows.
ALTER TABLE table_name
ADD CONSTRAINT MyUniqueConstraint UNIQUE(column1, column2...);
The basic syntax of an ALTER TABLE command to ADD CHECK CONSTRAINT to a table is as follows.
ALTER TABLE table_name
ADD CONSTRAINT MyUniqueConstraint CHECK (CONDITION);
The basic syntax of an ALTER TABLE command to ADD PRIMARY KEY constraint to a table is as
follows.
ALTER TABLE table_name
ADD CONSTRAINT MyPrimaryKey PRIMARY KEY (column1, column2...);
The basic syntax of an ALTER TABLE command to DROP CONSTRAINT from a table is as follows.
ALTER TABLE table_name
DROP CONSTRAINT MyUniqueConstraint;
SQL
Visit : python.mykvs.in for regular updates
17. Database Commands in MySql
Altering Table
ALTER TABLE table_name
DROP INDEX MyUniqueConstraint;
The basic syntax of an ALTER TABLE command to DROP PRIMARY KEY constraint from a table is as
follows.
ALTER TABLE table_name
DROP CONSTRAINT MyPrimaryKey;
If we are using MySQL, the code is as follows −
ALTER TABLE table_name
DROP PRIMARY KEY;
SQL
Visit : python.mykvs.in for regular updates
18. MySQL Order By clause is used to sort the table data in
either Ascending order or Descending order. By default,
data is not inserted into Tables in any order unless we have
an index.
So, If we want to retrieve the data in any particular order,
we have to sort it by using MySQL Order By statement.
Syntax:-SELECT Column_Names
FROM Table_Name
ORDER BY {Column1}[ASC | DESC] {Column2}[ASC | DESC]
Visit : python.mykvs.in for regular updates
SQL
19. MySQL Order by– e.g.
Suppose we are having student table with following data.
Now we write the query – select * from student order by class;
Query result will be in ascending order of class.If we not specify asc/desc in
query then ascending clause is applied by default
Visit : python.mykvs.in for regular updates
SQL
20. MySQL Order by– e.g.
Suppose we are having student table with following data.
Now we write the query – select * from student order by class desc;
Query result will be in descending order of class
Visit : python.mykvs.in for regular updates
SQL
21. MySQL Order by – e.g.
Suppose we are having student table with following data.
Now we write query–select * from student order by class asc, marks asc;
Query result will be ascending order of class and if same class exists
then ordering will done on marks column(ascending order)
Visit : python.mykvs.in for regular updates
SQL
22. MySQL Order by– e.g.
Suppose we are having student table with following data.
Now we write query–select * from student order by class asc, marks desc;
Query result will be ascending order of class and if same class exists
then ordering will done on marks column(descending order)
Visit : python.mykvs.in for regular updates
SQL
23. An aggregate function performs a calculation on multiple values
and returns a single value. For example, you can use the AVG()
aggregate function that takes multiple numbers and returns the
average value of the numbers.Following is the list of aggregate
functions supported by mysql.
Name Purpose
SUM() Returns the sum of given column.
MIN() Returns the minimum value in the given column.
MAX() Returns the maximum value in the given column.
AVG() Returns the Average value of the given column.
COUNT() Returns the total number of values/ records as per given
column.
SQL
Visit : python.mykvs.in for regular updates
24. Aggregate Functions & NULL
Consider a table Emp having following records as-
Null values are excluded while (avg)aggregate function is used
SQL Queries
mysql> Select Sum(Sal) from EMP;
mysql> Select Min(Sal) from EMP;
mysql> Select Max(Sal) from EMP;
mysql> Select Count(Sal) from EMP;
mysql> Select Avg(Sal) from EMP;
mysql> Select Count(*) from EMP;
Emp
Code Name Sal
E1 Mohak NULL
E2 Anuj 4500
E3 Vijay NULL
E4 Vishal 3500
E5 Anil 4000
Result of query
12000
3500
4500
3
4000
5
Visit : python.mykvs.in for regular updates
SQL
25. The GROUP BY clause groups a set of rows/records into a
set of summary rows/records by values of columns or
expressions. It returns one row for each group.
We often use the GROUP BY clause with aggregate
functions such as SUM, AVG, MAX, MIN, and COUNT. The
aggregate function that appears in the SELECT clause
provides information about each group.
The GROUP BY clause is an optional clause of the SELECT
statement.
Syntax –
SELECT 1, c2,..., cn, aggregate_function(ci)
FROM table WHERE where_conditions GROUP BY c1 , c2,...,cn;
Here c1,c2,ci,cn are column name
Visit : python.mykvs.in for regular updates
SQL
26. MySQL group by – e.g.
Suppose we are having student table with following data.
Now we write query–select class from student group by class;
Query result will be unique occurrences of class values,just similar
to use distinct clause like(select distinct class from student).
Visit : python.mykvs.in for regular updates
SQL
27. MySQL GROUP BY with aggregate functions
The aggregate functions allow us to perform the calculation of a set of rows and return a
single value. The GROUP BY clause is often used with an aggregate function to perform
calculation and return a single value for each subgroup.
For example, if we want to know the number of student in each class, you can use the
COUNT function with the GROUP BY clause as follows:Suppose we are having student table
with following data.
Now we write query–select class,count(*) from student group by class;
Query result will be unique occurrences of class values along with counting of
students(records) of each class(sub group).
Visit : python.mykvs.in for regular updates
SQL
28. MySQL GROUP BY with aggregate functions
we are having student table with following data.
Now we write query–select class,avg(marks) from student group by class;
Query result will be unique occurrences of class values along with average
marks of each class(sub group).
Visit : python.mykvs.in for regular updates
SQL
29. MySQL GROUP BY with aggregate functions (with where and order by clause)
we are having student table with following data.
Now we write query–select class,avg(marks) from student where class<10 group
by class order by marks desc;
Query result will be unique occurrences of class values where class<10 along with
average marks of each class(sub group) and descending ofer of marks.
Visit : python.mykvs.in for regular updates
SQL
30. The HAVING clause is used in the SELECT
statement to specify filter conditions for a
group of rows or aggregates. The HAVING
clause is often used with the GROUP BY
clause to filter groups based on a specified
condition. To filter the groups returned by
GROUP BY clause, we use a HAVING clause.
WHERE is applied before GROUP BY, HAVING
is applied after (and can filter on aggregates).
Visit : python.mykvs.in for regular updates
SQL
31. MySQL GROUP BY with aggregate functions & having clause
we are having student table with following data.
Now we write query–select class,avg(marks) from student group by class
having avg(marks)<90;
Query result will be unique occurrences of class values along with average
marks of each class(sub group) and each class having average marks<90.
Visit : python.mykvs.in for regular updates
SQL
32. MySQL GROUP BY with aggregate functions & having clause
we are having student table with following data.
Now we write query–select class,avg(marks) from student group by class
having count(*)<3;
Query result will be unique occurrences of class values along with average
marks of each class(sub group) and each class having less than 3 rows.
Visit : python.mykvs.in for regular updates
SQL
33. Cartesian product (X)/cross joint
Cartesian Product is denoted by X symbol.
Lets say we have two relations R1 and R2
then the cartesian product of these two
relations (R1 X R2) would combine each tuple
of first relation R1 with the each tuple of
second relation R2.
Visit : python.mykvs.in for regular updates
SQL
34. Cartesian product (X) example
Table a and Table b as shown
below
Mysql query –
Select * from a,b;
Select * from a cross join b;
Visit : python.mykvs.in for regular updates
Degree of cartesion product is 3 and cardinality is 4=(2 rows of a X 2 rows of b)
SQL
35. Join – Join is used to fetch data from two or more tables,
which is joined to appear as single set of data. It is used for
combining column from two or more tables by using values
common to both tables.
Types of JOIN
Following are the types of JOIN that we can use in SQL:
• Inner
• Outer
• Left
• Right
Visit : python.mykvs.in for regular updates
SQL
36. INNER Join or EQUI Join⋈
This is a simple JOIN in which the result is
based on matched data as per the equality
condition specified in the SQL query.
Visit : python.mykvs.in for regular updates
SQL
37. INNER Join or EQUI Join example
Table a and Table b as shown below
Mysql query –
Select course.student_name from
couse , student where
course.student_name=student.stude
nt_name;
Select a.name from a inner join b
where a.name=b.name;
Visit : python.mykvs.in for regular updates
SQL
38. Natural JOIN(⋈)
Natural Join is a type of Inner join which is based on
column having same name and same datatype present
in both the tables to be joined.E.g.
Select * from a natural join b;
Visit : python.mykvs.in for regular updates
SQL
39. LEFT Outer Join
The left outer join returns a resultset table with the matched data from the
two tables and then the remaining rows of the left table and null from the
right table's columns. E.g.
Mysql query –
Select * from a left outer join b on
(a.name=b.name);
Visit : python.mykvs.in for regular updates
SQL
40. RIGHT Outer Join
The right outer join returns a resultset table with the matched data from the
two tables being joined, then the remaining rows of the right table and null
for the remaining left table's columns.E.g.
Mysql query –
Select * from a right outer join b on
(a.name=b.name);
Visit : python.mykvs.in for regular updates
SQL
41. Full Outer Join
The full outer join returns a resultset table with the matched data of two
table then remaining rows of both left table and then the right table.E.g.
Mysql query –
Select * from a left outer join b on
(a.name=b.name) union Select * from
a right outer join b on
(a.name=b.name) ;
Visit : python.mykvs.in for regular updates
SQL