0% found this document useful (0 votes)
158 views5 pages

Class 11 MySQL Study Notes

Uploaded by

sidhb.tyagi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
158 views5 pages

Class 11 MySQL Study Notes

Uploaded by

sidhb.tyagi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MYSQL Notes 11th

Data base lists: mysql> show databases;

Create Database: mysql> create database revision;

Open Database: mysql> use revision;

Create Table: mysql> create table example1(

Sname varchar(50),
Sadmno int(10) primary key NOT NULL,
DOB DATE NOT NULL,
ParentPhNo Int(10) UNIQUE,
Class char(1),
Section char(1));
See Table Format: mysql> describe example1;

Insert into table: mysql> INSERT INTO example1 VALUES ('Sidhant


Bhardwaj', '140541', '2009-07-07', '9309538', 'X', 'A');

Show entered data in table: mysql> select*from example1;


Some Imp commands:-

☝️Note this does not change name of column it just displays


column with other name

☝️Note this changes name of column from Sadmno to


admissionno

Use this command for caste discrimination👇😈


Change can be seen here
CHAR VARCHAR
Fixed-length: Always stores Variable-length: Stores only
exactly n characters. Pads what’s needed (up to n characters).
with spaces if data is shorter. No padding.

Slightly faster for fixed-size Saves space.


data (like codes: 'A4', 'M'). Slightly slower but flexible.
Uses more storage if values
are short.

Examples of database management systems:- Oracle, MySQL,


MicrosoftSQL Server, PostgreeSQL...

In order to access data from the MySQL database, all


program and user must use SQL (Structured Query
Language). SQL is a set of commands that are
recognized by all the RDBMSs and has become a
standard language for database handling.
SQL is a language that enables you to create and
manage
a relational database, in which all the information are
kept in tables.

MySQL is an Open Source, Fast and Reliable Relational Database


Management System (RDBMS) software like Oracle, Sybase, MS
SQL
Server etc. It was developed by Michael Widenius and AKA Monty
and is
alternative to many of the commercial RDBMS.
The main features of MySQL are-
 Open Source & Free of Cost:
It is Open Source and available at free of cost.
 Portability:
It can be installed and run on any types of Hardware and OS like
Linux,
MS Windows or Mac etc.
 Security :
It creates secured database protected with password.
 Connectivity
It may connect various types of Network client using different
protocols
and Programming Languages .
 Query Language
It uses SQL (Structured Query Language) for handling database.

Keep Adding……

Common questions

Powered by AI

SQL is a standard language for relational database management because it offers a consistent set of commands that are universally recognized across various relational database management systems (RDBMS). In MySQL, SQL enables users to create, modify, and interact with databases through a structured query format, making database management efficient and standardized .

Structured Query Language (SQL) plays a central role in handling relational databases by allowing for the creation and management of databases and tables, as well as performing data manipulation operations like inserting, updating, deleting, and retrieving data. In MySQL, SQL serves as the primary interface for interacting with the database, ensuring a standardized approach to database management .

SQL plays a crucial role in ensuring compatibility between different RDBMS platforms by providing a standardized language that can be universally implemented and understood. This allows SQL commands used in MySQL to be compatible with other database systems like Oracle and Microsoft SQL Server, facilitating data migration and integration across different platforms without complex rewrites .

Primary keys and unique constraints in MySQL databases ensure data integrity by preventing duplicate entries and establishing unique identifiers for records. For instance, in the example table 'example1', the 'Sadmno' column is defined as a primary key to uniquely identify each record, while 'ParentPhNo' is set as a unique constraint to ensure no duplicate phone numbers are entered .

In MySQL, the CHAR data type is used for fixed-length strings, always storing exactly n characters, and padding with spaces if the data is shorter than the defined length. This makes CHAR slightly faster when the data length is consistent, like fixed-size codes. In contrast, VARCHAR is a variable-length data type, storing only the necessary amount of data up to the specified limit without padding. This saves storage space and offers flexibility at the cost of slightly slower performance when data sizes vary significantly .

MySQL's portability enhances its utility by allowing it to be installed and run on various types of hardware and operating systems, including Linux, Windows, and macOS. This flexibility enables users to deploy MySQL databases in diverse environments without requiring significant changes to the system architecture or workflow, thus broadening its applicability in different computing contexts .

The advantages of using MySQL as an open-source RDBMS software include cost-effectiveness, as it is free of charge, and flexibility, as it is portable and can run on various operating systems such as Linux, Windows, and macOS. Moreover, being open-source, MySQL allows for extensive customization and community-driven improvements, offering a reliable and scalable solution for database management compared to commercial alternatives .

The significance of MySQL being an open-source platform lies in its global impact on software development, allowing developers worldwide to access, modify, and distribute the software without licensing fees. This fosters innovation and collaboration, leading to rapid enhancements and widespread adoption. It also enables organizations, particularly in developing regions, to build robust database solutions cost-effectively, promoting digital transformation worldwide .

MySQL supports connectivity across various network clients and platforms by leveraging different network protocols and programming languages. This multi-faceted connectivity ensures reliable data exchange and interaction between MySQL databases and client applications, facilitating seamless database operations over networks. Specific protocols and languages are not detailed in the provided sources, but typically include TCP/IP, ODBC, and programming languages such as Java, PHP, and Python .

MySQL ensures database security by implementing a password-protected system to safeguard data access. It allows secure connections over networks and offers robust authentication protocols. Additionally, it integrates seamlessly with various programming languages and network protocols to maintain secure data interactions .

You might also like