SlideShare a Scribd company logo
1 of 9
Download to read offline
R DBM S    elation   ata   ase   anagement   ystem




Name:
Class:
Section:
Roll No:
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------


                                                        BASICS OF RDBMS (SQL)


*         What is DBMS?

Ans:      DBMS stands for          Data Base Management System.
        A Database Management System is system software that is used to Create, Maintain and provide
controlled access to the user databases. (OR)

      A Database Management System is a process of maintaining the data in the database in a
systematic form.

*      What is Data?

       ͞Data͟ is nothing but ͞Facts͟. (OR)

          The actual data stored in the database is called DATA. For example, the student database may
        contain data like Student Roll No, Student Name, Student Address, etc͙.

*      What is Database?

        Database is known as ͞collection of Data͟. (OR)
          An organised collection of logically related data is called Database. The Database may contain the
        information about a particular organization or Enterprise. An Organization may be a College, University, Bank,
        etc͙

*       Data v/s Information?

         We define the information as data that it would be processed, so the user may easily identify the
        data.

          For example, consider the following list of facts.
          Rahul         12465           60

          Mohan                20518                40

          Arun                 30198                70

                     The above data remains useless. We have no idea what the entire data means.

          For example, we will place some data in the context form. Now it is useful data for some users.

                     Sri Vaishnavi degree College, Rajampet

          Name                 Reg No               Percentage

          Rahul                12465                60

          Mohan                20578                40

          Arun                 30198                70

------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 2
Designed by S.V.NIKETHAN 8019958900                               RDBMS
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------
*       Metadata:

          Metadata is nothing but data about data . (OR)

          The data that describes the properties or characteristic features of other data is called Metadata.

          For example, consider the Metadata for the about student data on listed below.

          Data Item Name                    Type                          Size      Description

                     Name                 Alphabetic                      20        Student Name

                     Reg No               Numeric                         10        Student Reg No

                     Percentage           Numeric                         2         Marks Percentage

*       RDBMS:

          RDBMS stands for Relation Database Management System.

              A database that represents data as a collection of tables in which all the data relationships
can be maintained by the actual values in the related tables.

             The Relation Data model was 1st introduced in ͞1970͟ by ͞E.F.Codd.͟

*       What is SQL?

          SQL stands for Structure Query Language.

                  Basically a Structure Query Language is a non procedural language. i.e.; the user needs to
        specify the problem and not the procedure to same it. SQL is a very simple language that can be
        learned and maintained easily.

*       Procedural Language:

          Example:

                     Having a Railway Reservation from friend.

               1.    Catch the bus.
               2.    Go to the Railway Station.
               3.    Fill the Reservation form.
               4.    Take ticket.
               5.    Again catch the bus &
               6.    Come to home.

*       Non procedural Language:

          Example:

            Get me a Railway Reservation.




------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 3
Designed by S.V.NIKETHAN 8019958900                               RDBMS
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------
*       What are the features of SQL?

               1.    Reduction in Language code.
               2.    Simplicity in writing code.
               3.    Skills of writing simple code.
               4.    Reduction of maintaining software.

*     How to start or enter into SQL?

Ans: Go to start menu. Select All programs. In that, select Oracle ʹ OraHome81. Then select Application
     Development. Then click on SQL plus option.

          Start All programs              Oracle - OraHome Application Development                             SQL Plus       Enter

  An ͞Oracle SQL Plus͟ window is open with a small ͞Logon͟ textbox. In that, enter ͞username͟ as ͞scott͟
and password as ͞tiger͟. Then click on ͞OK͟ button.

          Now the SQL window is open.

*     Different types of SQL Commands or Compo nents of SQL?

Ans: The SQL commands are categorized into different types. They are:

     1.   DDL Data Definition Language
     2.   DML Data Manipulation Language
     3.   DQL Data Query Language
     4.   DCL Data Control Language
     5.   TCS Transaction Control Statement
     6.   DAS Data Audit Statement
     1.    DDL commands :
           DDL commands are used to create, Alter and Delete the Database objects like Table. The
          commands are ͞CREATE͟, ͞ALTER͟ and ͞DROP͟.
          A. CREATE:
            This command is used to create a table.
          Syntax:
            CREATE table <table name> (<colname 1 > <Data type> <size>,
                                        <colname 2 > <Data type> <size>,
                                          .             .         .
                                          .              .         .
                                          .             .         .
                                       <colname n > <Data type> <size>);
          Example:

            CREATE table student (RNo Number(10),

                                            S.Name varchar2(20),

                                            Sub 1 Number (3),

                                            Sub 2 Number (3),

                                            Sub 3 Number(3),

                                            Sub 4 Number(3),
------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 4
Designed by S.V.NIKETHAN 8019958900                               RDBMS
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------
                                              Sub 5 Number(3),

                                            Sub 6 Number (3));



             B.ALTER:

               This command contains the THREE commands. They are:

                                   I.     ADD
                                                                                                          ALTER
                                  II.     MODIFY
                                 III.     DROP

                                                                                     ADD                  MODIFY               DROP
               I.ADD:

                This command is used to add a column to the existing table.

                   Syntax:

                     ALTER table < table name> ADD <colname> < Data type> < size>);

                      Example:

                     ALTER table Student ADD (Total Number (4));

                  Message: Table ALTER

             II.MODIFY:

                    This command is used to modify the data type or size of the column.

                  Syntax:

                      ALTER table < table name> MODIFY <colname> < Data type> < size>);

                   Example:

                     ALTER table Student MODIFY (SName varchar2 (30));

                  Message: Table ALTER

             III.DROP:

                    This command is used to delete a column.

                  Syntax:

                      ALTER table < table name> DROP <colname>);

                   Example:

                     ALTER table Student MODIFY (SName);



------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 5
Designed by S.V.NIKETHAN 8019958900                               RDBMS
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------
2. DML commands:

          DML commands are used to insert, update and delete the data in the database. The commands
used are ͞INSERT͟, ͞UPDATE͟ and ͞DELETE͟.



                  A. INSERT:
                       This command is used to insert record into the table. This command has Three (3)
 syntaxes.
    Syntax 1:
       INSERT into <table name > values (value 1, value 2 ͙ value n);
    Example:

          INSERT into Student values ( 1008,͛Nikethan͛, 60, 77, 86, 98, 99, 91);

     Syntax 2:
        INSERT into <table name> (colname 1, colname 2 ... colnamen) values (value1, value2...value n);


3. DQL commands:

             SQL has only one Query statement. The command used is ͞SELECT͟.

SELECT:

  This command is used to retrieve the required data fro m the database.

  Syntax:

     SELECT astric (*) from <table name>;

Example:

   SELECT * from student;

1.Using SELECT command by using ORDER BY:

          This command is used to display the data in ͚Descending order͛ & ͚Ascending order͛ in the user
specify column name. In this, we have two (2) Syntaxes.

Syntax:
                                                                                                      To see data in
SELECT astric (*) from <table name> ORDER BY <colane> DESC;
                                                                                                      Descending order
Example:

SELECT * from student ORDER BY Roll No DESC;

Syntax:

SELECT astric (*) from <table name> ORDER BY <colane>;                                                 To see data in

Example:                                                                                               Ascending order

SELECT * from student ORDER BY Roll No ;

------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 6
Designed by S.V.NIKETHAN 8019958900                               RDBMS
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------
2. Using SELECT command by using GROUP BY:

             This command is used to display the specified data in groupwise.

Syntax:

SELECT Colname1, Colname2 from <tale name> GROUP BY <Colname>;

Example:

SELECT Dept No, SUM(SAL) from EMP GROUP BY Dept no;

3. Using SELECT command by applying HAVING:

             This command is used to specify the data by the user require condition.

Syntax:

SELECT colname1,colname2 from <table name> GROUP BY <colname> HAVING <condition>;

Example:

SELECT Dept No, SUM(SAL) from EMP GROUP BY Dept no HAVING SUM(SAL) > 15,000;

                                                LIST OF SPECIAL SELECT COMMANDS
 1. SELECT UPPER (S.Name) from Student;
          This command is used to display the student name in upper case.
 2. SELECT LOWER (S.Name) from Student;
          This command is used to display the student name in lower case.
 3. SELECT CONCAT (͚National͛, ͚Integrity͛)from dual;
          This command is used to combine TWO words.
 4. SELECT GREATEST (͛06-Jan -09͛,͛20 ʹ Mar ʹ 09 ) from dual;
          This command is used to display the greatest date among TWO above dates.
 5. SELECT LTRIM ( ͚Super Computer͛,͛ Super͛) from dual;
          This command is used to trim the specified word LEFT side.
 6. SELECT RTRIM ( ͚Super Computer͛,͛ Super͛) from dual;
          This command is used to trim the specified word RIGHT side.
 7. SELECT LPAD (RPAD(͚B.Com͛,10,͟#͛),15,͛&͛)from dual;
          This command is used to display the LEFT padding symbols & RIGHT padding symbols specified by
     the user.
 8. SELECT LAST_DAY(05-Jan-09) from dual;
          This command is used to LAST DAY in the specified date.
 9. SELECT MONTHS_BETWEEN(͛09-Jan-10͛)from dual;
          This command is used to display the no. of months between the specified date.
 10. SELECT POWER(2,5)from dual;
          This command is used to display the POWER of specified values.
 11. SELECT LENGTH (͚NIKETHAN͛)from dual;
          This command is used to display the LENGTH of the specified text.
 12. SELECT ROUND(8.124)from dual;
          This command is used to ROUND the specified text.
 13. SELECT SYS_DATE from dual;
          This command is used to display the present SYSTEM DATE.
------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 7
Designed by S.V.NIKETHAN 8019958900                               RDBMS
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------
 14. SELECT SYS_TIME from dual;
              This command is used to display the present SYSTEM TIME.
 15. SELECT SQRT (25) from dual;
              This command is used to find out SQUARE ROOT of the specified number.

4. DCL commands:

      DCL commands is used to manage the data that the manipulation performed by the DML
commands. The DCL commands are ͞COMMIT͟, ͞ROLLBACK͟ and ͞SAVEPOINT͟.

             A. COMMIT: This command is used to ͞SAVE͟ the table.

                     Ex: COMMIT;

             B. ROLL BACK: This command is used to ͞ROLLBACK͟ to the specified location.

                     Ex: ROLLBACK;

             C. SAVEPOINT: This command is used to ͞SAVE͟ the table in the form of modules.

                     Ex: SAVEPOINT SP;

5. TCS commands:

        TCS commands are used to control the user access to the database. The commands are ͞GRANT͟
and ͞REVOKE͟.

             A. GRANT: This command is used ro grant the permission to the user.

                     Syntax: Grant dba to <username>;

                     Ex: Grant dba to Nikethan;

             B. REVOKE: This command is used to call off (cancel) the permission to the user.

                     Syntax: REVOKE from <username>;

6. DAS commands:

             DAS commands are used to perform auditing. The commands used are ͞START AUDIT͟ and ͞STOP
AUDIT͟.

Creation of New user:

             1. Enter username as ͞system͟
             2. Enter password as ͞manager͟

                     Now, the SQL window will open.

             Type as follows:

                     SQL> CREATE user Nikethan (username) identified by 143 (password);

             user created.

Accessing Permission: SQL> Grant dba to Nikethan;

------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 8
Designed by S.V.NIKETHAN 8019958900                               RDBMS
----------------------------------------------------- --RDBMS -----------------------------------------------------------------------------------------
Message: Permission granted.

Cancelling Permission: SQL> Revoke dba from Nikethan;

Message: Revoke succeed.




------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 9
Designed by S.V.NIKETHAN 8019958900                               RDBMS

More Related Content

Viewers also liked

Festa infantil
Festa infantilFesta infantil
Festa infantilericajulia
 
The Mindset Behind Buying into China Internet
The Mindset Behind Buying into China InternetThe Mindset Behind Buying into China Internet
The Mindset Behind Buying into China InternetBen JIANG
 
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือ
ใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือ
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือNutz Dobii
 
The little prince
The little princeThe little prince
The little princeyuchat001
 
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือ
ใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือ
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือNutz Dobii
 
Rregullore e hollandes
Rregullore e hollandesRregullore e hollandes
Rregullore e hollandesArben LIÇI
 

Viewers also liked (20)

Festa infantil
Festa infantilFesta infantil
Festa infantil
 
The Mindset Behind Buying into China Internet
The Mindset Behind Buying into China InternetThe Mindset Behind Buying into China Internet
The Mindset Behind Buying into China Internet
 
At8
At8At8
At8
 
Se1
Se1Se1
Se1
 
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือ
ใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือ
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือ
 
Policing gets smarter
Policing gets smarterPolicing gets smarter
Policing gets smarter
 
The little prince
The little princeThe little prince
The little prince
 
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือ
ใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือใบงาน   แบบสำรวจและประวัติของ     นางสาวณัฐวดี บรรลือ
ใบงาน แบบสำรวจและประวัติของ นางสาวณัฐวดี บรรลือ
 
Presentation1
Presentation1Presentation1
Presentation1
 
Amigo Group
Amigo GroupAmigo Group
Amigo Group
 
Rregullore e hollandes
Rregullore e hollandesRregullore e hollandes
Rregullore e hollandes
 
At10
At10At10
At10
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Chrome os
Chrome osChrome os
Chrome os
 
Holography
HolographyHolography
Holography
 
Deforestation
Deforestation Deforestation
Deforestation
 
ZTE Grand S3
ZTE Grand S3ZTE Grand S3
ZTE Grand S3
 
Surf and ransac
Surf and ransacSurf and ransac
Surf and ransac
 
G e o r g i a
G e o r g i aG e o r g i a
G e o r g i a
 
Graphene
GrapheneGraphene
Graphene
 

Similar to RDBM S: Relational Database Management System

My SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMy SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMarkus Flechtner
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sqlzahid6
 
1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptxMullaMainuddin
 
Air Line Management System | DBMS project
Air Line Management System | DBMS projectAir Line Management System | DBMS project
Air Line Management System | DBMS projectAniketHandore
 
May Woo Bi Portfolio
May Woo Bi PortfolioMay Woo Bi Portfolio
May Woo Bi Portfoliomaywoo
 
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdfDBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdfAbhishekKumarPandit5
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfpradnyamulay
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresSteven Johnson
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slidesmetsarin
 

Similar to RDBM S: Relational Database Management System (20)

My SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMy SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please help
 
Module02
Module02Module02
Module02
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Sql
SqlSql
Sql
 
SQL - RDBMS Concepts
SQL - RDBMS ConceptsSQL - RDBMS Concepts
SQL - RDBMS Concepts
 
1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 
Air Line Management System | DBMS project
Air Line Management System | DBMS projectAir Line Management System | DBMS project
Air Line Management System | DBMS project
 
May Woo Bi Portfolio
May Woo Bi PortfolioMay Woo Bi Portfolio
May Woo Bi Portfolio
 
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdfDBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
DBMS LAB FILE1 task 1 , task 2, task3 and many more.pdf
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
 
SQLQueries
SQLQueriesSQLQueries
SQLQueries
 
PT- Oracle session01
PT- Oracle session01 PT- Oracle session01
PT- Oracle session01
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome Measures
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
Dbms &amp; oracle
Dbms &amp; oracleDbms &amp; oracle
Dbms &amp; oracle
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
Sql
SqlSql
Sql
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

RDBM S: Relational Database Management System

  • 1. R DBM S elation ata ase anagement ystem Name: Class: Section: Roll No:
  • 2. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- BASICS OF RDBMS (SQL) * What is DBMS? Ans: DBMS stands for Data Base Management System. A Database Management System is system software that is used to Create, Maintain and provide controlled access to the user databases. (OR) A Database Management System is a process of maintaining the data in the database in a systematic form. * What is Data? ͞Data͟ is nothing but ͞Facts͟. (OR) The actual data stored in the database is called DATA. For example, the student database may contain data like Student Roll No, Student Name, Student Address, etc͙. * What is Database? Database is known as ͞collection of Data͟. (OR) An organised collection of logically related data is called Database. The Database may contain the information about a particular organization or Enterprise. An Organization may be a College, University, Bank, etc͙ * Data v/s Information? We define the information as data that it would be processed, so the user may easily identify the data. For example, consider the following list of facts. Rahul 12465 60 Mohan 20518 40 Arun 30198 70 The above data remains useless. We have no idea what the entire data means. For example, we will place some data in the context form. Now it is useful data for some users. Sri Vaishnavi degree College, Rajampet Name Reg No Percentage Rahul 12465 60 Mohan 20578 40 Arun 30198 70 ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 2 Designed by S.V.NIKETHAN 8019958900 RDBMS
  • 3. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- * Metadata: Metadata is nothing but data about data . (OR) The data that describes the properties or characteristic features of other data is called Metadata. For example, consider the Metadata for the about student data on listed below. Data Item Name Type Size Description Name Alphabetic 20 Student Name Reg No Numeric 10 Student Reg No Percentage Numeric 2 Marks Percentage * RDBMS: RDBMS stands for Relation Database Management System. A database that represents data as a collection of tables in which all the data relationships can be maintained by the actual values in the related tables. The Relation Data model was 1st introduced in ͞1970͟ by ͞E.F.Codd.͟ * What is SQL? SQL stands for Structure Query Language. Basically a Structure Query Language is a non procedural language. i.e.; the user needs to specify the problem and not the procedure to same it. SQL is a very simple language that can be learned and maintained easily. * Procedural Language: Example: Having a Railway Reservation from friend. 1. Catch the bus. 2. Go to the Railway Station. 3. Fill the Reservation form. 4. Take ticket. 5. Again catch the bus & 6. Come to home. * Non procedural Language: Example: Get me a Railway Reservation. ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 3 Designed by S.V.NIKETHAN 8019958900 RDBMS
  • 4. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- * What are the features of SQL? 1. Reduction in Language code. 2. Simplicity in writing code. 3. Skills of writing simple code. 4. Reduction of maintaining software. * How to start or enter into SQL? Ans: Go to start menu. Select All programs. In that, select Oracle ʹ OraHome81. Then select Application Development. Then click on SQL plus option. Start All programs Oracle - OraHome Application Development SQL Plus Enter An ͞Oracle SQL Plus͟ window is open with a small ͞Logon͟ textbox. In that, enter ͞username͟ as ͞scott͟ and password as ͞tiger͟. Then click on ͞OK͟ button. Now the SQL window is open. * Different types of SQL Commands or Compo nents of SQL? Ans: The SQL commands are categorized into different types. They are: 1. DDL Data Definition Language 2. DML Data Manipulation Language 3. DQL Data Query Language 4. DCL Data Control Language 5. TCS Transaction Control Statement 6. DAS Data Audit Statement 1. DDL commands : DDL commands are used to create, Alter and Delete the Database objects like Table. The commands are ͞CREATE͟, ͞ALTER͟ and ͞DROP͟. A. CREATE: This command is used to create a table. Syntax: CREATE table <table name> (<colname 1 > <Data type> <size>, <colname 2 > <Data type> <size>, . . . . . . . . . <colname n > <Data type> <size>); Example: CREATE table student (RNo Number(10), S.Name varchar2(20), Sub 1 Number (3), Sub 2 Number (3), Sub 3 Number(3), Sub 4 Number(3), ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 4 Designed by S.V.NIKETHAN 8019958900 RDBMS
  • 5. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- Sub 5 Number(3), Sub 6 Number (3)); B.ALTER: This command contains the THREE commands. They are: I. ADD ALTER II. MODIFY III. DROP ADD MODIFY DROP I.ADD: This command is used to add a column to the existing table. Syntax: ALTER table < table name> ADD <colname> < Data type> < size>); Example: ALTER table Student ADD (Total Number (4)); Message: Table ALTER II.MODIFY: This command is used to modify the data type or size of the column. Syntax: ALTER table < table name> MODIFY <colname> < Data type> < size>); Example: ALTER table Student MODIFY (SName varchar2 (30)); Message: Table ALTER III.DROP: This command is used to delete a column. Syntax: ALTER table < table name> DROP <colname>); Example: ALTER table Student MODIFY (SName); ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 5 Designed by S.V.NIKETHAN 8019958900 RDBMS
  • 6. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- 2. DML commands: DML commands are used to insert, update and delete the data in the database. The commands used are ͞INSERT͟, ͞UPDATE͟ and ͞DELETE͟. A. INSERT: This command is used to insert record into the table. This command has Three (3) syntaxes. Syntax 1: INSERT into <table name > values (value 1, value 2 ͙ value n); Example: INSERT into Student values ( 1008,͛Nikethan͛, 60, 77, 86, 98, 99, 91); Syntax 2: INSERT into <table name> (colname 1, colname 2 ... colnamen) values (value1, value2...value n); 3. DQL commands: SQL has only one Query statement. The command used is ͞SELECT͟. SELECT: This command is used to retrieve the required data fro m the database. Syntax: SELECT astric (*) from <table name>; Example: SELECT * from student; 1.Using SELECT command by using ORDER BY: This command is used to display the data in ͚Descending order͛ & ͚Ascending order͛ in the user specify column name. In this, we have two (2) Syntaxes. Syntax: To see data in SELECT astric (*) from <table name> ORDER BY <colane> DESC; Descending order Example: SELECT * from student ORDER BY Roll No DESC; Syntax: SELECT astric (*) from <table name> ORDER BY <colane>; To see data in Example: Ascending order SELECT * from student ORDER BY Roll No ; ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 6 Designed by S.V.NIKETHAN 8019958900 RDBMS
  • 7. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- 2. Using SELECT command by using GROUP BY: This command is used to display the specified data in groupwise. Syntax: SELECT Colname1, Colname2 from <tale name> GROUP BY <Colname>; Example: SELECT Dept No, SUM(SAL) from EMP GROUP BY Dept no; 3. Using SELECT command by applying HAVING: This command is used to specify the data by the user require condition. Syntax: SELECT colname1,colname2 from <table name> GROUP BY <colname> HAVING <condition>; Example: SELECT Dept No, SUM(SAL) from EMP GROUP BY Dept no HAVING SUM(SAL) > 15,000; LIST OF SPECIAL SELECT COMMANDS 1. SELECT UPPER (S.Name) from Student; This command is used to display the student name in upper case. 2. SELECT LOWER (S.Name) from Student; This command is used to display the student name in lower case. 3. SELECT CONCAT (͚National͛, ͚Integrity͛)from dual; This command is used to combine TWO words. 4. SELECT GREATEST (͛06-Jan -09͛,͛20 ʹ Mar ʹ 09 ) from dual; This command is used to display the greatest date among TWO above dates. 5. SELECT LTRIM ( ͚Super Computer͛,͛ Super͛) from dual; This command is used to trim the specified word LEFT side. 6. SELECT RTRIM ( ͚Super Computer͛,͛ Super͛) from dual; This command is used to trim the specified word RIGHT side. 7. SELECT LPAD (RPAD(͚B.Com͛,10,͟#͛),15,͛&͛)from dual; This command is used to display the LEFT padding symbols & RIGHT padding symbols specified by the user. 8. SELECT LAST_DAY(05-Jan-09) from dual; This command is used to LAST DAY in the specified date. 9. SELECT MONTHS_BETWEEN(͛09-Jan-10͛)from dual; This command is used to display the no. of months between the specified date. 10. SELECT POWER(2,5)from dual; This command is used to display the POWER of specified values. 11. SELECT LENGTH (͚NIKETHAN͛)from dual; This command is used to display the LENGTH of the specified text. 12. SELECT ROUND(8.124)from dual; This command is used to ROUND the specified text. 13. SELECT SYS_DATE from dual; This command is used to display the present SYSTEM DATE. ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 7 Designed by S.V.NIKETHAN 8019958900 RDBMS
  • 8. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- 14. SELECT SYS_TIME from dual; This command is used to display the present SYSTEM TIME. 15. SELECT SQRT (25) from dual; This command is used to find out SQUARE ROOT of the specified number. 4. DCL commands: DCL commands is used to manage the data that the manipulation performed by the DML commands. The DCL commands are ͞COMMIT͟, ͞ROLLBACK͟ and ͞SAVEPOINT͟. A. COMMIT: This command is used to ͞SAVE͟ the table. Ex: COMMIT; B. ROLL BACK: This command is used to ͞ROLLBACK͟ to the specified location. Ex: ROLLBACK; C. SAVEPOINT: This command is used to ͞SAVE͟ the table in the form of modules. Ex: SAVEPOINT SP; 5. TCS commands: TCS commands are used to control the user access to the database. The commands are ͞GRANT͟ and ͞REVOKE͟. A. GRANT: This command is used ro grant the permission to the user. Syntax: Grant dba to <username>; Ex: Grant dba to Nikethan; B. REVOKE: This command is used to call off (cancel) the permission to the user. Syntax: REVOKE from <username>; 6. DAS commands: DAS commands are used to perform auditing. The commands used are ͞START AUDIT͟ and ͞STOP AUDIT͟. Creation of New user: 1. Enter username as ͞system͟ 2. Enter password as ͞manager͟ Now, the SQL window will open. Type as follows: SQL> CREATE user Nikethan (username) identified by 143 (password); user created. Accessing Permission: SQL> Grant dba to Nikethan; ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 8 Designed by S.V.NIKETHAN 8019958900 RDBMS
  • 9. ----------------------------------------------------- --RDBMS ----------------------------------------------------------------------------------------- Message: Permission granted. Cancelling Permission: SQL> Revoke dba from Nikethan; Message: Revoke succeed. ------------------------------------- ----------------------------------------------------------------------------------------------------------- Page | 9 Designed by S.V.NIKETHAN 8019958900 RDBMS