Tuesday, 13 May 2014

Chapter 11
Introduction to MySQL


1
What is MYSQL? By which company was MYSQL developed?
Ans.
MYSQL is a free, open-source Relational Database Management System. MySQL was
 developed by MySQL AB a
company based in Sweden.
2
What are thvarious key features of MYSQL?
Ans.
ü   Speed
ü   Ease of use
ü   Query language supported
ü   Portability
ü   Security
3
What is MYSQL server?
Ans.
MySQL server listens for client requests coming in over the network and accesses database contents according to those requests and provides that to the clients.
4
What is MYSQL client?
Ans.
MySQL clients are programs that connect to the MySQL server and issue queries in a pre-specified format.MySQL is
compatible with the standards based SQL. The client program may contact the server programmatically omanually.
5
Which company created MYSQL?
Ans.
MySQL is created and supporteby MySQL AB, a company based in Sweden.
6
Whicopen source enterprise environment is MYSQL part of?
Ans.
MySQL is a part LINUX operating system is opesource environment.
7
What is SQL? What are the different categories of SQL commands?
Ans.
SQL is the set of commands that is recognized by nearly all RDBMSs.
SQL commands can be divided into following categories:
1.   Data definition Language (DDL) commands.
2.   Data Manipulation Language (DML) Commands.
3.   TransactioControl Language (TCL) Commands.
4.   SessioControl Commands.
5.   System Control Commands.
8
What types of commands arused in the following categories?
(i)DDL (ii)DML (iii)TCL
(iv)Session Control Commands
(vSystem Control Commands.
Ans.
(i)   DDL CREATE, ALTER, DROP
(ii)  DML  SELECT,DELETE,INSERT INTO,UPDATE
(iii) TCL COMMIT,ROLLBACK, SAVEPOINT, SET TRANSACTION 
(iv) SessioControl Commands  ALTER SESSION and SET ROLE (v System Control Command - ALTER SYSTEM
9
What does the Data Dictionary consists of?
Ans.
Data Dictionary consists of metadata i.e., data about data.

10
What is thusof SQL in MySQL?
Ans.
ü   SQL is a language that enables yoto create and operate on relational databases, which are sets of related
information stored in tables.
ü    It allows user to learn one set of commands and use it to create, retrieve, alter, and transfer information regardless of whether they are working on a PC, a workstation, a mini, or a mainframe.
11
How arSQL commands classified?
Ans.
SQL provides many different types of commands used for different purpose. SQL commands can be mainly divided
into following categories:
1.   Data Definition Language (DDL)  commands that allow yoto perform tasks relateto data definitioe.g.,
ü   Creating, altering and dropping.
ü   Granting and revoking privileges and roles.
ü   Maintenance commands
2.   Data Manipulation Language (DML)  commands that allow yoto perform data manipulation e. g.,
ü   Retrieval, insertion, deletion and modificatioof data stored in a database.
3.   Transaction Control Language (TCL)  commands that allow yotmanage and control the transactions e.g.,
ü   Making changes to database permanent
ü   Undoing changes to database, permanent
ü   Creating savepoints
ü   Setting properties for current transaction
12
        12.  Differentiate between DDL and DML commands.
Ans
       The Data Definition Language (DDL) commands, as the name suggests, allow you to perform                               tasks relateto data definition. That is, through these commands, you can perform tasks like, create, alter and           drop schema objects, grant and revoke privileges etc.
        The Data Manipulation Language (DML) commands, as the name suggests, are used                                        to manipulate data. That is, DML commands query and manipulate data in existing schema objects.
13
Namsome tablmaintenanccommands.
Ans.
CREATE - CREATE TABLE table_name (column_name column_type);
ALTER - ALTER TABLE testalter_tbl DROP column_name;
UPDATE - UPDATE table_name SET field1=new-value1, field2=new-value2 [WHERE Clause]; SELECT - SELECT field1, field2,...fieldN table_name1, table_name2.. [WHERE Clause]; DELETE - DELETE FROM table_name [WHERE Clause];
DROP - DROP TABLE table_name ;
INSERT - INSERT INTO table_name ( field1, field2,...fieldN) VALUES ( value1, value2,...valueN );
14
Discuss thdifferent categories of commands of SQL.
Ans
SQL provides many different types of commands used for different purpose. SQL commands can be mainly divided into following categories:
1. Data Definition Language (DDL)  commands that allow you to perform tasks related to data definitioe.g.,
ü   Creating, altering and dropping.
ü   Granting and revoking privileges and roles.
ü   Maintenance commands
2. Data Manipulation Language (DML)  commands that allow yoto perform data manipulation e. g.,
ü   Retrieval, insertion, deletion and modificatioof data stored in a database.
3.TransactioControl Language (TCL)  commands that allow you to manage and control the transactions e.g.,
ü   Making changes to database permanent
ü   Undoing changes to database, permanent
ü   Creating savepoints
ü   Setting properties for current transactions.