Page 51 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 51

Database Management Systems/Managing Database




                    Notes          Step I
                                   Cross product of E and D
                                   Step II
                                   Apply qualification condition

                                   E.eid = D.Dept_managerid AND
                                   D.Dname = ‘Accounts’ to the cross product table and select second and sixth row.
                                   Step III
                                   Discard all the unwanted columns and the result contains only the ename field.

                                   Result of Step-II


                                    Hid  Ename  D.No.  Esal  Age  Phone  DepLManagerid  D.No.  D.Natne   D .Location   P.No.
                                    101   John    2   35000   50  24578912    101   2   Accounts   Secunderabad    11
                                    97   Harry    5   30000   41  23535135    97   5   Accounts   Hyderabad    22

                                   Result of Step-III

                                   Ename
                                   John

                                   Harry
                                   This indicates that John and Harry are the employees whose department name is ‘Accounts’.




                                      Task       In DBMS when you can use WHERE clause.

                                   3.6 Creating Tables

                                   The create table statement is used to create a new table. Here is the format of a simple create
                                   table statement:
                                   create table “tablename”
                                   (“column1” “data type”,

                                   “column2” “data type”,
                                   “column3” “data type”);
                                   Format of create table if you were to use optional constraints:
                                   create table “tablename”
                                   (“column1” “data type”

                                   [constraint],
                                   “column2” “data type”
                                   [constraint],





          44                                LOVELY PROFESSIONAL UNIVERSITY
   46   47   48   49   50   51   52   53   54   55   56