Monday, July 15, 2013

DBMS-DML

EX.NO:2                DATA MANIPULATION AND DATA CONTROL LANGUAGE
                                    (Insert, select, update and delete commands)

AIM:

       To execute the Data Manipulation Language (DML) and Data Control Language (DCL) commands in RDBMS.

Data Manipulation Language-Syntax :

INSERT:

INSERT INTO <table name> values
(
      fieldvalue-1,fieldvalue-2,…,fieldvalue-n
);

INSERT INTO <table name> VALUES
(
      &fieldname-1,&fieldname-2,…&fieldname-n
);

INSERT INTO <table name>
(
      SELECT(att_list) FROM <existing table name>
);

SELECT


            SELECT(att_list) FROM <table name> [WHERE <condition/expression>];

UPDATE


            UPDATE <table name> SET
            (
                        fieldname-1 = value, fieldname-2 = value,…,fieldname-n  = value)
                        [WHERE <condition/expression>];    );

DELETE


            DELETE FROM <table name>
                        [WHERE <condition/expression>];

Data Control Language:
            Data control language provides users with privilege commands.

GRANT

            Used to give privilege to user on object

Grant privilege on <object_name> to <user name>;

REVOKE

            Used to withdraw the privilege that has been granted to the user.

Revoke privilege on <object_name> from <user name>;

Sample Output

                      INSERT, SELECT, UPDATE AND DELETE COMMANDS

SQL> create table person(pid int, lastname varchar2(10),firstname varchar(10),
address varchar2(20),age number);

Table created.

INSERTING A SINGLE ROW INTO A TABLE

SQL> insert into person values(1,'Prettina','Anne','Bangalore',14);

1 row created.

SQL> insert into person values(2,'Benitto','Anish','Trichy',24);

1 row created.

SQL> select * from person;

   PID        LASTNAME             FIRSTNAME         ADDRESS         AGE
---------- ---------- ---------- -------------------- ----------
    1          Prettina              Anne            Bangalore        14
    2          Benitto               Anish           Trichy           24

INSERTING MORE THAN ONE ROW USING A SINGLE INSERT COMMAND

SQL> insert into person values(&pid,'&lastname','&firstname','&address',&age);
Enter value for pid: 3
Enter value for lastname: Raj
Enter value for firstname: Anita
Enter value for address: Chennai
Enter value for age: 27
old   1: insert into person values(&pid,'&lastname','&firstname','&address',&age)
new   1: insert into person values(3,'Raj','Anita','Chennai',27)

1 row created.

SQL> /
Enter value for pid: 4
Enter value for lastname: kumar
Enter value for firstname: Ashok
Enter value for address: Coimbatore
Enter value for age: 30
old   1: insert into person values(&pid,'&lastname','&firstname','&address',&age)
new   1: insert into person values(4,'kumar','Ashok','Coimbatore',30)

1 row created.

SQL> select * from person;

       PID LASTNAME   FIRSTNAME  ADDRESS                         AGE
---------- ---------- ---------- -------------------- ----------
       1  Prettina              Anne       Bangalore           14
       2  Benitto              Anish      Trichy              24
       3  Raj                    Anita       Chennai             27
       4  kumar               Ashok       Coimbatore          30

SKIPPING THE FIELDS WHILE INSERTING

SQL> insert into person(pid,lastname,firstname) values(5,Hinn,Benny);
insert into person(pid,lastname,firstname) values(5,'Hinn','Benny')

1 row created.

SQL> select * from person;

       PID       LASTNAME       FIRSTNAME        ADDRESS      AGE
---------- ---------- ---------- -------------------- ----------
       1   Prettina              Anne           Bangalore     14
       2   Benitto              Anish          Trichy        24
       3   Raj                     Anita          Chennai       27
       4   kumar                Ashok        Coimbatore      30
       5   Hinn                  Benny

INSERT VALUES USING MEANINGFUL FIELD NAMES

SQL> insert into person values(&personid,'&lastname','&firstname','&personaddress',&age);
Enter value for personid: 6
Enter value for lastname: Prakash
Enter value for firstname: Bhaskar
Enter value for personaddress: Andhra
Enter value for age: 40
old   1: insert into person values(&personid,'&lastname','&firstname','&personaddress',&age)
new   1: insert into person values(6,'Prakash','Bhaskar','Andhra',40)

1 row created.

SQL> select * from person;

       PID   LASTNAME     FIRSTNAME  ADDRESS      AGE
---------- ----------    ---------- -------------------- ----------
      1            Prettina  Anne     Bangalore      14
      2    Benitto   Anish    Trichy         24
      3    Raj       Anita    Chennai        27
      4    kumar     Ashok    Coimbatore     30
      5    Hinn      Benny
      6    Prakash   Bhaskar  Andhra         40

6 rows selected.

UPDATE VALUES USING CONDITION

SQL> update person set address='United States'where pid=5;

1 row updated.

UPDATE VALUES USING &

SQL> update person set address ='&address',age=&age where pid=&pid;
Enter value for address: Assam
Enter value for age: 40
Enter value for pid: 6
old   1: update person set address ='&address',age=&age where pid=&pid
new   1: update person set address ='Assam',age=40 where pid=6

1 row updated.

SQL> /
Enter value for address: Britain
Enter value for age: 55
Enter value for pid: 5
old   1: update person set address ='&address',age=&age where pid=&pid
new   1: update person set address ='Britain',age=55 where pid=5

1 row updated.

SELECT COMMAND TO RETRIEVE THE ENTIRE INFORMATION FROM THE TABLE

SQL> select * from person;

       PID LASTNAME   FIRSTNAME  ADDRESS        AGE
---------- ---------- ---------- -------------------- ----------
         1             Prettina              Anne       Bangalore       14
         2             Benitto              Anish      Trichy          24
         3             Raj                     Anita      Chennai         27
         4             kumar                Ashok      Coimbatore      30
         5             Hinn                  Benny      Britain         55
         6             Prakash           Bhaskar    Assam           40

6 rows selected.

SELECT COMMAND USING 'WHERE' CLAUSE

SQL>select * from person where lastname= 'Kumar' and address='Coimbatore';

       PID LASTNAME   FIRSTNAME  ADDRESS                     AGE
---------- ---------- ---------- -------------------- ----------
         4 Kumar      Ashok      Coimbatore                   30
         7 Kumar      Chander    Coimbatore                   45

SELECT COMMAND TO RETRIEVE THE TOP VALUES

SQL> select * from person where rownum<=3;

  PID    LASTNAME   FIRSTNAME               ADDRESS          AGE
---------- ---------- ---------- -------------------- ----------
   1       Prettina            Anne                   Bangalore          14
   2       Benitto            Anish                   Trichy             24
   3       Raj             Anita             Chennai              27

SELECT COMMAND WITH LIKE OPERATOR

SQL> select * from person where address like 'C%';


      PID         LASTNAME      FIRSTNAME     ADDRESS        AGE
---------- ---------- ---------- -------------------- ----------
      3              Raj           Anita      Chennai         27
      4              kumar         Ashok      Coimbatore      30

SQL> select * from person where address like '%i%';

       PID    LASTNAME   FIRSTNAME   ADDRESS            AGE
---------- ---------- ---------- -------------------- ----------
       2      Benitto     Anish       richy              24
       3      Raj         Anita       Chennai            27
       4      Kumar       Ashok       Coimbatore         30
       5      Hinn        Benny       Britain            55

SELECT COMMAND USING IN OPERATOR

SQL> select * from person where lastname in('Prettina');

       PID   LASTNAME    FIRSTNAME  ADDRESS    AGE
---------- ---------- ---------- -------------------- ----------
         1   Prettina    Anne       Bangalore   14

SELECT COMMAND USING BETWEEN OPERATOR

SQL> insert into person values(7,'Kumar','Chander','Coimbatore',45);

1 row created.

SQL> select * from person where lastname between 'Kumar' and 'Kumar';

      PID  LASTNAME    FIRSTNAME   ADDRESS      AGE
--------- ---------- ---------- -------------------- ----------
       6     Kumar      Ashok       Coimbatore   30
       7     Kumar      Chander     Coimbatore   45

SELECT COMMAND TO ELIMINATE DUPLICATES

SQL> select DISTINCT lastname from person;

LASTNAME
----------
Benitto
Hinn
Kumar
Prakash
Prettina
Raj
6 rows selected.

SELECT COMMAND WITH ORDER BY CLAUSE

SQL> select pid, firstname,age from person order by age;

   PID      FIRSTNAME    AGE
---------- ---------- ----------
    1           Anne        14
    2           Anish       24
    3           Anita       27
    4           Ashok       30
    6           Bhaskar     40
    7           Chander     45
    5           Benny       55

7 rows selected.

SELECT COMMAND TO CREATE A TABLE

SQL> create table individual as select * from person;

Table created.

SQL> select * from individual;

   PID      LASTNAME   FIRSTNAME  ADDRESS      AGE
---------- ---------- ---------- ------------  --------
     1         Prettina   Anne       Bangalore      14
     2         Benitto    Anish      Trichy         24
     3         Raj        Anita      Chennai        27
     4         Kumar      Ashok      Coimbatore     30
     5         Hinn       Benny      Britain        55
     6         Prakash    Bhaskar    Assam          40
     7         Kumar      Chander    Coimbatore     45

7 rows selected.

SELECT COMMAND TO INSERT RECORDS

SQL> insert into individual(select * from person);

7 rows created.

SELECT COMMAND WITH FUNCTIONS

SQL> select count(*) as pid from person;

       PID
----------
         7

SQL> select count(distinct lastname) as pid from person;

       PID
----------
         6

SQL> select max(age) from person;

  MAX(AGE)
----------
        55

SQL> select min(age) from person;

  MIN(AGE)
----------
        14

SQL> select sum(age) from person;

  SUM(AGE)
----------
       235

DATA CONTROL LANGUAGE (DCL) COMMANDS

SQL> select * from person;

  PID    LASTNAME  FIRSTNAME   ADDRESS       AGE
------- ---------- ---------- ------------ --------
   1       Prettina    Anne       BAngalore      14
   2       Benitto     Anish      Trichy         24
   3       Raj         Anita      Chennai        27
   4       Kumar       Ashok      Coimbatore     30
   5       Hinn        Benny      Britain        55
   6    Prakash     Bhaskar    Assam          40
   7    Kumar       Chander    Coimbatore     45

7 rows selected.

SQL> commit;

Commit complete.

DELETE COMMAND

SQL> delete from person where lastname='Kumar';

2 rows deleted.

SQL> select * from person;

  PID   LASTNAME   FIRSTNAME  ADDRESS       AGE
------ ---------- ---------- ------------ --------
   1       Prettina   Anne       BAngalore       14
   2       Benitto    Anish      Trichy          24
   3       Raj        Anita      Chennai         27
   5       Hinn       Benny      Britain         55
   6    Prakash    Bhaskar    Assam           40

SQL> rollback;

Rollback complete.

SQL> select * from person;

  PID    LASTNAME   FIRSTNAME  ADDRESS        AGE
------- ---------- ---------- ------------ -------
   1       Prettina    Anne       BAngalore       14
   2       Benitto     Anish      Trichy          24
   3       Raj         Anita      Chennai         27
   4       Kumar       Ashok      Coimbatore      30
   5       Hinn        Benny      Britain         55
   6       Prakash     Bhaskar    Assam           40
   7       Kumar       Chander    Coimbatore      45

7 rows selected.

SQL> savepoint s1;

Savepoint created.

SQL> delete from person;

7 rows deleted.

SQL> select * from person;

no rows selected

SQL> rollback to savepoint s1;

Rollback complete.

SQL> select * from person;

  PID   LASTNAME   FIRSTNAME  ADDRESS        AGE
------ ---------- ---------- ------------- -------
   1       Prettina   Anne       BAngalore         14
   2       Benitto    Anish      Trichy            24
   3       Raj        Anita      Chennai           27
   4       Kumar      Ashok      Coimbatore        30
   5       Hinn       Benny      Britain           55
   6       Prakash    Bhaskar    Assam             40
   7       Kumar      Chander    Coimbatore        45

7 rows selected.


RESULT:


Thus the Data Manipulation Language (DML) and Data Control Language (DCL) commands in RDBMS were executed and verified.

DBMS-DDL

EX.NO:1   DATA DEFINITION LANGUAGE, TABLE CREATION, CONSTRAINTS


AIM:
    To execute the Data Definition Language (DDL) commands and creating the table with constraints using RDBMS.


Data Definition Language-Syntax:

CREATE TABLE


            CREATE TABLE <table name>
            {
                        fieldname-1 datatype,
                        fieldname-2 datatype,
                        …….
                        Fieldname-n datatype
                };


CREATE TABLE <table name> AS
(
            SELECT(att-list) FROM <existing table name>
);

 


ALTER TABLE


            ALTER TABLE <table  name> ADD/MODIFY
            (
                        fieldname-1 datatype,
                        fieldname-2 datatype,
                        …..
                        fieldname-n datatype
            );

            ALTER TABLE DROP COLUMN column name;

DROP TABLE

  • All data and structure in the table is deleted
  • Any pending transactions are committed
  • All indexes are dropped
  • We can not rollback the drop table statement.

            DROP TABLE <table name>;

DESCRIBING TABLE

            Desc table name

CHANGING NAME OF AN OBJECT

            To change the name of a table, view, sequence, or synonym, execute the rename statement.

            Rename old name to new name

TRUNCATE

            The truncate table statement :
·         Removes all rows from a table
·         Release the storage space used by that table
·         We cannot rollback row removal when using truncate.         
            TRUNCATE TABLE <table name>;

SET UNUSED OPTION:

            Used to mark one or more columns as unused.

ALTER TABLE table name SET UNUSED(column name )
                        (or)
ALTER TABLE table name SET UNUNSED COLUMN column name

REFERENCING ANOTHER USER TABLE

 Table belonging to other users are not in the user’s schema, we should use the owner’s name as prefix to those tables.

            Select * from user name .table name

QUERYING THE DATA DICTIONARY

·         To see the names of tables owned by the user

Select table_name from user_tables;

·         To view distinct object types owned by the user

Select Distinct object_type from user_objects;

·         To view tables, views, synonyms and sequences owned by the user;

Select * from user_catalog;
CONSTRAINTS:

To implement Domain Integrity Constraints, Entity Integrity Constraints, Referential Integrity Constraints
Integrity Constraints are used to enforce rules that the columns in a table have to conform with. It is a mechanism used by Oracle to prevent invalid data entry into the table.
  1. Domain Integrity Constraints
    1. Not Null Constraint – The enforcement of Not Null Constraints in a table ensures that the table contain values
    2. Check Constraint – Allow only a particular range of values
  2. Entity Integrity Constraints
    1. Unique Constraints – The unique constraint designates a Column or a group of columns as unique key. This allows only unique value to be stored in the column. Rejects duplication.
    2. Primary Key Constraints – Primary key similar to unique key. avoids duplication , relation between two tables , does not allow not null values
  3. Referential Integrity Constraints
Enforces relationship between tables. It designates a column or group of columns as a foreign key
Ø  Foreign Key – establish a relationship with the specified primary or unique key in another table
Parent Table – Referenced key
Child table – Primary or unique table


            Sample Output

                                                            CONSTRAINTS

            NOT NULL, UNIQUE AND CHECK CONSTRINTS

            SQL> create table vendor_master(vencode varchar(5) unique,
            venname varchar(7) not null);

            Table created.

            SQL> desc vendor_master;
             Name                                   Null?    Type
             ----------------------------------------- -------- ---------
            VENCODE                                         VARCHAR2(5)
             VENNAME                                NOT NULL VARCHAR2(7)

            SQL> alter table vendor_master add(productprice number(10)
            check(productprice<10000));

            Table altered.

            SQL> insert into vendor_master values('v001','Sony TV',9100);

            1 row created.

            UNIQUE CONSTRAINT VIOLATION

            SQL> insert into vendor_master values('&vencode','&venname',
            &productprice);
            Enter value for vencode: v001
            Enter value for venname: Philips
            Enter value for productprice: 6000
            old   1: insert into vendor_master values('&vencode','&venname',
            &productprice)
            new   1: insert into vendor_master values('v001','Philips',6000)
            insert into vendor_master values('v001','Philips',6000)
            *
            ERROR at line 1:
            ORA-00001: unique constraint (USER06.SYS_C002807) violated


            SQL> ed
            Wrote file afiedt.buf

             1* insert into vendor_master values('&vencode','&venname',
            &productprice)
            SQL> /
            Enter value for vencode: v002
            Enter value for venname: Sony TV
            Enter value for productprice: 6000
            old   1: insert into vendor_master values('&vencode','&venname',
            &productprice)
            new   1: insert into vendor_master values('v002','Sony TV',6000)

            1 row created.

            NULL CONSTRAINT VIOLATION

            SQL> /
            Enter value for vencode: v003
            Enter value for venname:
            Enter value for productprice: 9000
            old   1: insert into vendor_master values('&vencode','&venname',
            &productprice)
            new   1: insert into vendor_master values('v003','',9000)
            insert into vendor_master values('v003','',9000)
            *
            ERROR at line 1:
            ORA-01400: cannot insert NULL into ("USER06"."VENDOR_MASTER".
            "VENNAME")


            SQL> /
            Enter value for vencode: v003
            Enter value for venname: Philips
            Enter value for productprice: 8000
            old   1: insert into vendor_master values('&vencode','&venname',
            &productprice)
            new   1: insert into vendor_master values('v003','Philips',8000)

            1 row created.

            CHECK CONSTRAINT VIOLATION

            SQL> /
            Enter value for vencode: v004
            Enter value for venname: Akai
            Enter value for productprice: 12000
            old   1: insert into vendor_master values('&vencode','&venname',
            &productprice)
            new   1: insert into vendor_master values('v004','Akai',12000)
            insert into vendor_master values('v004','Akai',12000)
            *
            ERROR at line 1:
            ORA-02290: check constraint (USER06.SYS_C002809) violated


            SQL> /
            Enter value for vencode: v005
            Enter value for venname: Aiwa
            Enter value for productprice: 8500
            old   1: insert into vendor_master values('&vencode','&venname',
            &productprice)
            new   1: insert into vendor_master values('v005','Aiwa',8500)

            1 row created.


            PRIMARY AND FOREIGN KEY CONSTRAINTS

            SQL> create table order_master(orderno varchar(5) constraint order_prim
            primary key,odate date,
                vencode varchar(5),o_status char(1) not null,deldate date);

            Table created.

            SQL> desc order_master;
            Name                                      Null?    Type
             ----------------------------------------- -------- ------------------
             ORDERNO                                   NOT NULL VARCHAR2(5)
             ODATE                                              DATE
             VENCODE                                            VARCHAR2(5)
            O_STATUS                                  NOT NULL CHAR(1)
            DELDATE                                            DATE

            SQL> create table order_detail(orderno varchar2(5) ,itemcode varchar(3),
            qtyorder number(3),
            foreign key(orderno) references order_master on delete cascade on
            update cascade);

            Table created.

            SQL> desc order_detail;
             Name                                      Null?    Type
            ----------------------------------------- -------- -----------------
            ORDERNO                                            VARCHAR2(5)
            ITEMCODE                                           VARCHAR2(3)
            QTYORDER                                           NUMBER(3)


            SQL> insert into order_master values('&oredrno','&odate','&vencode',
            '&o_status','&deldate');
            Enter value for oredrno: o001
            Enter value for odate: 12-aug-2009
            Enter value for vencode: v001
            Enter value for o_status: p
            Enter value for deldate: 12-sep-2009
            old   1: insert into order_master values('&oredrno','&odate','&vencode',
            '&o_status','&deldate')
            new   1: insert into order_master values('o001','12-aug-2009','v001','p',
            '12-sep-2009')

            1 row created.

            PRIMARY KEY CONSTRAINT VIOLATION

            SQL> /
            Enter value for oredrno: o001
            Enter value for odate: 11-nov-2008
            Enter value for vencode: v002
            Enter value for o_status: p
            Enter value for deldate: 14-feb-2010
            old   1: insert into order_master values('&oredrno','&odate','&vencode',
            '&o_status','&deldate')
            new   1: insert into order_master values('o001','11-nov-2008','v002','p',
            '14-feb-2010')
            insert into order_master values('o001','11-nov-2008','v002','p',
            '14-feb-2010')
            *
            ERROR at line 1:
            ORA-00001: unique constraint (USER06.ORDER_PRIM) violated


            SQL> /
            Enter value for oredrno: o002
            Enter value for odate: 13-jan-2007
            Enter value for vencode: v002
            Enter value for o_status: p
            Enter value for deldate: 16-oct-2009
            old   1: insert into order_master values('&oredrno','&odate','&vencode',
            '&o_status','&deldate')
            new   1: insert into order_master values('o002','13-jan-2007','v002','p',
            '16-oct-2009')

            1 row created.

            SQL> select * from order_master;

            ORDER ODATE     VENCO O DELDATE
            ----- --------- ----- - ---------
            o001  11-NOV-08 voo2  p 14-FEB-10
            o002  13-JAN-07 v002  p 16-OCT-09


            FOREIGN KEY CONSTRAINT VIOLATION

            SQL> insert into order_detail values('&orderno','&itemcode',&qtyorder);
            Enter value for orderno: o003
            Enter value for itemcode: i01
            Enter value for qtyorder: 25
            old   1: insert into order_detail values('&orderno','&itemcode',&qtyorder)
            new   1: insert into order_detail values('o003','i01',25)
            insert into order_detail values('o003','i01',25)
            *
            ERROR at line 1:
            ORA-02291: integrity constraint (USER06.SYS_C002814) violated - parent key
            not
            found

            SQL> /
            Enter value for orderno: o001
            Enter value for itemcode: i01
            Enter value for qtyorder: 25
            old   1: insert into order_detail values('&orderno','&itemcode',&qtyorder)
            new   1: insert into order_detail values('o001','i01',25)

            1 row created.

            SQL> select * from order_detail;

            ORDER ITE   QTYORDER
            ----- --- ----------
            o001  i01         25

            SQL>delete from order_master where orderno='o001'
            *
            ERROR at line 1:
            ORA-02292: integrity constraint (USER06.SYS_C002814) violated - child
            record found

            USING on delete cascade with foreign key constraint

            SQL> drop table order_master;

            Table dropped.

            SQL> drop table order_detail;

            Table dropped.

            SQL> create table order_master(orderno varchar(5) constraint order_prim
             primary key, odate date,
                vencode varchar(5),o_status char(1) not null,deldate date);

            SQL>create table order_detail(orderno varchar2(5) ,itemcode varchar(3),
            qtyorder number(3),
             foreign key(orderno) references order_master on delete cascade);


            Table created.

            SQL> insert into order_master values('&oredrno','&odate','&vencode',
            '&o_status','&deldate');

            Enter value for oredrno: o001
            Enter value for odate: 12-jan-2007
            Enter value for vencode: voo1
            Enter value for o_status: p
            Enter value for deldate: 13-jun-2008
            old   1: insert into order_master values('&oredrno','&odate','&vencode',
            '&o_status','&deldate')
            new   1: insert into order_master values('o001','12-jan-2007','voo1','p',
            '13-jun-2008')

            1 row created.

            SQL> /
            Enter value for oredrno: o002
            Enter value for odate: 24-sep-2008
            Enter value for vencode: voo2
            Enter value for o_status: p
            Enter value for deldate: 16-jan-2010
            old   1: insert into order_master values('&oredrno','&odate','&vencode',
            '&o_status','&deldate')
            new   1: insert into order_master values('o002','24-sep-2008','voo2','p',
            '16-jan-2010')

            1 row created.

            SQL> select * from order_master;

            ORDER ODATE     VENCO O DELDATE
            ----- --------- ----- - ---------
            o001  12-JAN-07 voo1  p 13-JUN-08
            o002  24-SEP-08 voo2  p 16-JAN-10

            SQL> insert into order_detail values('&orderno','&itemcode',&qtyorder);
            Enter value for orderno: o001
            Enter value for itemcode: i01
            Enter value for qtyorder: 25
            old   1: insert into order_detail values('&orderno','&itemcode',&qtyorder)
            new   1: insert into order_detail values('o001','i01',25)
           
            1 row created.

            SQL> /
            Enter value for orderno: o002
            Enter value for itemcode: i02
            Enter value for qtyorder: 50
            old   1: insert into order_detail values('&orderno','&itemcode',&qtyorder)
            new   1: insert into order_detail values('o002','i02',50)

            1 row created.

            SQL> select * from order_detail;

            ORDER ITE   QTYORDER
            ----- --- ----------
            o001  i01         25
            o002  i02         50

            SQL> delete from order_master where orderno='o001';

            1 row deleted.


            SQL> select * from order_master;

            ORDER ODATE     VENCO O DELDATE
            ----- --------- ----- - ---------
            o002  24-SEP-08 voo2  p 16-JAN-10

            SQL> select * from order_detail;

            ORDER ITE   QTYORDER
            ----- --- ----------
            o002  i02         50

            [Note: Deletion of a row in parent is reflected in child table also. ]




RESULT:

Thus the Data Definition Language (DDL) and Data Control Language (DCL) commands in RDBMS were executed and verified.


Monday, March 25, 2013

KEYBOARD SHORTCUTS

KEYBOARD SHORTCUT KEYS

1. CTRL+C (Copy)
2. CTRL+X (Cut)
3. CTRL+V (Paste)
4. CTRL+Z (Undo)
5. DELETE (Delete)
6. SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
7. CTRL while dragging an item (Copy the selected item)
8. CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
9. F2 key (Rename the selected item)
10. CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
11. CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
12. CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
13. CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
14. CTRL+SHIFT with any of the arrow keys (Highlight a block of text)
SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
15. CTRL+A (Select all)
16. F3 key (Search for a file or a folder)
17. ALT+ENTER (View the properties for the selected item)
18. ALT+F4 (Close the active item, or quit the active program)
19. ALT+ENTER (Display the properties of the selected object)
20. ALT+SPACEBAR (Open the shortcut menu for the active window)
21. CTRL+F4 (Close the active document in programs that enable you to have multiple documents opensimultaneou sly)
22. ALT+TAB (Switch between the open items)
23. ALT+ESC (Cycle through items in the order that they had been opened)
24. F6 key (Cycle through the screen elements in a window or on the desktop)
25. F4 key (Display the Address bar list in My Computer or Windows Explorer)
26. SHIFT+F10 (Display the shortcut menu for the selected item)
27. ALT+SPACEBAR (Display the System menu for the active window)
28. CTRL+ESC (Display the Start menu)
29. ALT+Underlined letter in a menu name (Display the corresponding menu) Underlined letter in a command name on an open menu (Perform the corresponding command)
30. F10 key (Activate the menu bar in the active program)
31. RIGHT ARROW (Open the next menu to the right, or open a submenu)
32. LEFT ARROW (Open the next menu to the left, or close a submenu)
33. F5 key (Update the active window)
34. BACKSPACE (View the folder onelevel up in My Computer or Windows Explorer)
35. ESC (Cancel the current task)
36. SHIFT when you insert a CD-ROMinto the CD-ROM drive (Prevent the CD-ROM from automatically playing)
Dialog Box - Keyboard Shortcuts
1. CTRL+TAB (Move forward through the tabs)
2. CTRL+SHIFT+TAB (Move backward through the tabs)
3. TAB (Move forward through the options)
4. SHIFT+TAB (Move backward through the options)
5. ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
6. ENTER (Perform the command for the active option or button)
7. SPACEBAR (Select or clear the check box if the active option is a check box)
8. Arrow keys (Select a button if the active option is a group of option buttons)
9. F1 key (Display Help)
10. F4 key (Display the items in the active list)
11. BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)

Microsoft Natural Keyboard Shortcuts
1. Windows Logo (Display or hide the Start menu)
2. Windows Logo+BREAK (Display the System Properties dialog box)
3. Windows Logo+D (Display the desktop)
4. Windows Logo+M (Minimize all of the windows)
5. Windows Logo+SHIFT+M (Restorethe minimized windows)
6. Windows Logo+E (Open My Computer)
7. Windows Logo+F (Search for a file or a folder)
8. CTRL+Windows Logo+F (Search for computers)
9. Windows Logo+F1 (Display Windows Help)
10. Windows Logo+ L (Lock the keyboard)
11. Windows Logo+R (Open the Run dialog box)
12. Windows Logo+U (Open Utility Manager)
13. Accessibility Keyboard Shortcuts
14. Right SHIFT for eight seconds (Switch FilterKeys either on or off)
15. Left ALT+left SHIFT+PRINT SCREEN (Switch High Contrast either on or off)
16. Left ALT+left SHIFT+NUM LOCK (Switch the MouseKeys either on or off)
17. SHIFT five times (Switch the StickyKeys either on or off)
18. NUM LOCK for five seconds (Switch the ToggleKeys either on or off)
19. Windows Logo +U (Open Utility Manager)
20. Windows Explorer Keyboard Shortcuts
21. END (Display the bottom of the active window)
22. HOME (Display the top of the active window)
23. NUM LOCK+Asterisk sign (*) (Display all of the subfolders that are under the selected folder)
24. NUM LOCK+Plus sign (+) (Display the contents of the selected folder)
25. NUM LOCK+Minus sign (-) (Collapse the selected folder)
26. LEFT ARROW (Collapse the current selection if it is expanded, or select the parent folder)
27. RIGHT ARROW (Display the current selection if it is collapsed, or select the first subfolder)
Shortcut Keys for Character Map
After you double-click a character on the grid of characters, you can move through the grid by using the keyboard shortcuts:
1. RIGHT ARROW (Move to the rightor to the beginning of the next line)
2. LEFT ARROW (Move to the left orto the end of the previous line)
3. UP ARROW (Move up one row)
4. DOWN ARROW (Move down one row)
5. PAGE UP (Move up one screen at a time)
6. PAGE DOWN (Move down one screen at a time)
7. HOME (Move to the beginning of the line)
8. END (Move to the end of the line)
9. CTRL+HOME (Move to the first character)
10. CTRL+END (Move to the last character)
11. SPACEBAR (Switch between Enlarged and Normal mode when a character is selected)
Microsoft Management Console (MMC)
Main Window Keyboard Shortcuts
1. CTRL+O (Open a saved console)
2. CTRL+N (Open a new console)
3. CTRL+S (Save the open console)
4. CTRL+M (Add or remove a console item)
5. CTRL+W (Open a new window)
6. F5 key (Update the content of all console windows)
7. ALT+SPACEBAR (Display the MMC window menu)
8. ALT+F4 (Close the console)
9. ALT+A (Display the Action menu)
10. ALT+V (Display the View menu)
11. ALT+F (Display the File menu)
12. ALT+O (Display the Favorites menu)

MMC Console Window Keyboard Shortcuts
1. CTRL+P (Print the current page or active pane)
2. ALT+Minus sign (-) (Display the window menu for the active console window)
3. SHIFT+F10 (Display the Action shortcut menu for the selected item)
4. F1 key (Open the Help topic, if any, for the selected item)
5. F5 key (Update the content of all console windows)
6. CTRL+F10 (Maximize the active console window)
7. CTRL+F5 (Restore the active console window)
8. ALT+ENTER (Display the Properties dialog box, if any, for theselected item)
9. F2 key (Rename the selected item)
10. CTRL+F4 (Close the active console window. When a console has only one console window, this shortcut closes the console)
Remote Desktop Connection Navigation
1. CTRL+ALT+END (Open the Microsoft Windows NT Security dialog box)
2. ALT+PAGE UP (Switch between programs from left to right)
3. ALT+PAGE DOWN (Switch between programs from right to left)
4. ALT+INSERT (Cycle through the programs in most recently used order)
5. ALT+HOME (Display the Start menu)
6. CTRL+ALT+BREAK (Switch the client computer between a window and a full screen)
7. ALT+DELETE (Display the Windows menu)
8. CTRL+ALT+Minus sign (-) (Place a snapshot of the active window in the client on the Terminal server clipboard and provide the same functionality as pressing PRINT SCREEN on a local computer.)
9. CTRL+ALT+Plus sign (+) (Place asnapshot of the entire client window area on the Terminal server clipboardand provide the same functionality aspressing ALT+PRINT SCREEN on a local computer.)

Microsoft Internet Explorer Keyboard Shortcuts
1. CTRL+B (Open the Organize Favorites dialog box)
2. CTRL+E (Open the Search bar)
3. CTRL+F (Start the Find utility)
4. CTRL+H (Open the History bar)
5. CTRL+I (Open the Favorites bar)
6. CTRL+L (Open the Open dialog box)
7. CTRL+N (Start another instance of the browser with the same Web address)
8. CTRL+O (Open the Open dialog box,the same as CTRL+L)
9. CTRL+P (Open the Print dialog box)
10. CTRL+R (Update the current Web )