COMPUTER SCIENCE 
      IMPORTANT QUESTIONS ON CHAPTER - 3 (MySQL AND ITS IMPORTANCE)
      FOR EXAM.


      Fill in the blanks:

       

      1.       RDBMS stands for Relational Database Management System.

      2.       MySQL was created by Swedish Company MySQL AB in 1996.

      3.       The default limit for a table in MySQL is 4GB

      4.       There are five types of SQL commands.

      5.       DML commands are use to modify the database.

      6.       TCL commands can only used with DML commands like INSET, DELETE etc.

      7.       To view the existing database on the MySQL server, the query is SHOW DATABASES.

      8.       To select a database USE DATABASE command is used.

      9.       Removing the database means to delete the database physically.

      10.   A table in a database consist of many field with specific data types, such as numeric, string or data.

      11.   A table name can have a maximum of 30 characters.

      12.   A table name should begin with an alphabets.

      13.   Each table field definition is separated by comma.

      14.   A MySQL statement is terminated with semicolon.

      15.   DESC command is used to display the complete information about the field in a table.

      16.   We use the DROP TABLE command to delete a table permanently.

      17.   SELECT command is used to retrieve zero or more rows from a table.

      18.   The WHERE clause is used to retrive a particular records from a table.

      19.   To display unique values, the DISTINCT clause can be used.

      20.   %(percentage)sign is used to find a match for any string of any length, including zero length.

      21.   Undersign (_) allows finding a match for any single character.

      22.   Two Wild characters used with LIKE clause are % and _

      23.   The BETWEEN clause is used to search the data within the range.

      24.   NOT operator display only those record that do not specify the specific condition.

      25.   Sorting is used for arrange data in large database.

      26.   Sorting can be done in MySQl using the ORDER BY clause.

      27.   To sect the specific row(s) WHERE clause is used in the query.

      28.   CONSTRAINS are some rules that help ensure the validity of the data while entering it in the table.

      29.   The LIKE operator clause is used to compare one string value with another.

      30.   The ALTER table command s used to modify the table structure.

      31.   A primary key is  a column or a set of columns that uniquely identify each row in the table.

       

      Answer the following:

      1.       What is a database?

      A database is an organized collection of structured information or data stored automatically in a computer system.

      2.       Name the most popular Open Source RDBMS.

      MySQL.

      3.       Who are the developesr of MySQL?

      Michael Widenius, David Axmark and Allan Larsson.

      4.       MySQL is named after whom?

      MySQL was name after Michaek Widenus’s daughter name ‘My’.

      5.       Name the different types of SQL commands.

      DDL, DML, DCL, TCL, and DQL.

      6.       What is the use of DDL command? Nem two DDL Commands.

      DDL commands are used to change the structure of the table like creating a table, deleting a table, altering a table etc.

      Two DDL command are CREATE and ALTER.

      7.       What is the use of DML commands? Name two DML commands.

      DML commands are use to modify the database. It is responsible for all forms of changes in the database.

      Two DML commands are INSERT, UPDATE etc.

      8.       What is the use of DCL commands? Name two DCL commands?

      DCL commands are used to grant and take back authority from any database user.

      The two DCL commands are GRANT and REVOKE.

      9.       What is the use of TCL commands? Name two TCLL commands?

      TCL commands are used with DML commands like INSERT, DELETE and UPPDATE.

      The two TCL commands are INSERT and DELETE.

      10.   What is the use of DQL commands? Name two DQL commands?

      DQL commands are used to fetch the data from database.

      The two DQL commands are SELECT and SHOW.

      11.   Write the MySQl command used to know about the MySql version.

      SELECT VERSION();

      12.   Write the MySQL command to view the existing databases.

      SHOW DATABASES;

      13.   Write the MySQL command to select the database name SCHOOL.

      USE SCHOOL;

      14.   Write the MySQl command to create a new database name SCHOOL.

      15.   CREATE DATABASE SCHOOL;

      16.   Write the MySQL command to delete the database SCHOOL.

      DROP DATABASE SCHOOLL;

      17.   What is a record?

      A complete set of row in a table is called a record.

      18.   Which commands is used to create table in MySQL.

      CREATE TABLE command.

      19.   Write a syntax to create a table in MySQL.

      CREATE TABLE <table_name>(<column 1> <data_type> [size] [constrains],

      <column 2> <data_type> [size] [constrains],………..);

      20.   What are constraints?

      Constraints are some rules that help to ensure the valid of data while entering data in table.

      21.   List the constraints available in MySQL.

      PRIMARY KEY, NULL, NOT NULL, ENUM, UNIQUE etc.

      22.   Write the MySQL command to view the table with inserted records.

      SELECT* FROM <table_name>;

      23.   What is the use of ALTER command?

      ALTER Command is used to modify the structure of an existing table.

      24.   Write the MySQL command to add new column in the table STUDENT which can store one character as GENDER.

      ALTER TABLE STUDENT ADD GENDER CHAR(1);

      25.   Write the SQL command to remove the PRIMARY KEY constrains from the STUDENT.

      ALTER TABLE STUDENT DROP PRIMARY KEY;

      26.   Write a SQL command to add primary key to the table STUDENT in the field Roll_no.

      ALTER TABALE STUDENT ADD PRIMARY KEY(Roll_no);

      27.   Write a MySQL command to delete the table STUDENT

      DROP TABLE STUDENT;

      28.   Write the MySQL command to rename the table STUDENT TO STUDENT_INFO.

      ALTER TABLE STUDENT RENAME STUDENT_INFO;

      29.   Write the MySQL command to delete the column GENDER from the table STUDENT.

      ALTER TABLE STUDENT DROP GENDER;

      30.   What is the use of SELECT command?

      SELECT command is used to retrieve zero or more rows from a table.

      31.   What is the use of DISTINCT clause?

      DISTINCT CLAUSE is use to display only unique values in a column by eliminating the duplicate values.

      32.   What is the use of LIKE Clause in MySQL?

      Like Clause is use to compare one string with another string value.

      33.   Name two wild card characters used with LIKE clause.

      % (Percentage) and _ (Underscore sign).

      34.   How can you display selected rows from a table?

      We can display selected rows from a table by using WHERE clause.

      35.   What is the use of BETWEEN clause?

      BETWEEN clause is used to search data within the range.

      36.   What do you mean by sorting? Which command is used to short data in MySQL?

      Sorting is used for arranging data in large databases. ORDER BY command is used sort data in MySQl.

      37.   Which command is used to short the column in ascending order?

      ASC

      38.   Which command is used to short the column in descending order.

      DESC

      39.   What is the different between DELETE FROM STUDENT; and DELETE FROM STUDENT WHERE ROLL=1;

      DELETE FROM STUDENT will delete all the rows from the table whereas DELETE FROM STUDENT WHERE ROLL =Q; will delete the row where ROLL is 1.

      40.   What is the use of UPDATE command?

      UPDATE command is used to change or modify the data values in a table.

      41.   How UPDATE command is different from MODIFY command.

      UPDATE command is used to change or modify the data values in a table whereas MODIFY command is used o change or modify the data type of constrains of an existing table.

      42.   List any three group functions available in MySQL.

      SUM(), MAX() AND MIN()

      43.   Write the different between COUNT() and COUNT(*).

      COUNT() function returns the number of values in a specific column whereas COUNT(*) function returns the number of rows in a table.

      44.   What is aggregate function?

      Aggregate functions are applied on a group of values as input and return a single value as the result.

      45.   How can you display selected column in a table?

      We can display selected column by writing the column names after SELECT command. For example:

      SELECT ROLL, NAME, CLASS FROM STUDENT;







      Table of Content