SQL Notes Class 9.1736410857
SQL Notes Class 9.1736410857
Notes : Class 9
Topic-MY SQL
The data-driven world of today requires a lot of data to function. A majority of
the data is stored as databases, which is an organized collection of data. A
database management system or DBMS in short acts as a bridge between the
database and end-user to ensure that the data is well organized and easily
accessible. A DBMS assists in optimizing, storing, retrieving, and managing data in
databases.
MySQL is the most widely used database management system software for
managing relational databases today. It is an open-source database that is
supported by the Oracle Corporation. Many small and large businesses use
MySQL. It supports a variety of operating systems, including Windows, Linux,
macOS, and others. MySQL is a Relational Database Management System
(RDBMS) that offers a variety of features, including:It allows us to use tables,
rows, columns, and indexes and to perform database operations on them.
• Tables (collection of rows and columns), also known as relations, are used
to construct database relationships.
• It ensures that the Referential Integrity (referential integrity is an RDBMS
concept which states that any foreign key field must agree with the primary
key that is referenced by the foreign key) between rows or columns of
different tables is maintained.
• It automatically updates the table indexes as soon as a record is changed.
• It employs a number of SQL queries and integrates useful data from many
columns and rows for end-users.
13. View selected fields from the table satisfying the specified condition.
select name,class from student where class>5;
14. Counting the number of rows in a table.
select count(*) from student;
16. You can sort a result set in ascending and descending order by writing the
following code.
SELECT select_list FROM student ORDER BY name ASC, class DESC;