Saturday, July 30, 2011

Sql Fundamentals Notes


SQL COMMANDS

DDL (DATA DEFINATION LANGUAGE):-

DDL commands are used to create and remove database objects.
The commands are Create, Alter and Drop.

Create Command:-
This command is used to create the table.

Syntax:-create table
(col name datatype(w),col name data type(w));
Example: - create table aparna(sno number(2),name varchar2(10),m1 number(3), m2 number(3));

Rules:
  1. Table name should not be a oracle reserved words.
  2. It is not case sensitive; we can use upper and lower case.
  3. Table name should start with character.
  4. The length of the table name should be below 32 characters.

Alter command:-
This command is used to add a new column and to change the width of the column.

Syntax: - alter
modify/add ;
Example: - alter table aparna add m3 number (3);
Alter table aparna modify name varchar2 (20);

Drop commad:-
This command is used to delete the table.

Syntax: - Drop table
Example: - drop table aparna.


DCL (DATA CONTROL LANGUAGE):-

DCL commands are used to control the kind of data access to the database and also for transaction control.
The commands are Commit, Rollback, Save point.

Commit command:-
This command is used to save the transactions.

Syntax:- commit
Example:-commit

Rollback command:-
This command is used to scroll back the record (previous operations) only DCL commands. This command is exactly opposite of the commit command.

Syntax: - rollback
Example: - rollback.

Savepoint command: -
This command is used to saves the current point in the processing of a transaction. It is just like book mark in ms word.

Syntax: - savepoint

DML (DATA MANIPULATE LANGUAGE):-

DML commands are used for data manipulation.
The commands are Select, Insert, Update and Delete.

Select command: -
This command is used to retrieve the row from the database files.

Syntax: - select * from
Example:- select * from rama.

Insert command:-
This command is used to insert records in to the table.

Syntax: - insert into
values
Example: - insert into rama (sno, name, m1, m2, m3) values (&sno,’&name’, &m1,&m 2, &m 3);

Update command:-
This command is used to update the database records

Syntax: - update
set =number;
Example: - update emp set comm=sal*100;

Delete command:-
This command is used to delete the records from the data base.

Syntax: -delete from
where
Example: - delete from emp where sal>=500;

Note: - where clause is used to give conditions.

TCL (TRANCTION CONTROL LANGUAGE)

TCL commands are Grant and Invoke.

Grant command: -
This command is used to give access to the database that to grant permissions for the DML, DCL commands

Revoke command:-
This command is used to get back the given grant permission.


OTHER STANDARD COMMANDS:-

  1. Select * from tab;
This sql statement is used to get the list of tables.

  1. Select * from tab;
This command is used to view the information of the current user.


  1. Desc command:-

This command is used to display the structure of the table.

Syntax: - desc table name;
Example: - desc table rama;

These two Exercise can be easily done by practicing the above all commands

Exercise-25
Execute any six Sql commands
Exercise-26
Design a database in Sql for the sale receipt of medicines with the following columns:-
Sno, Name of the product, Quantity, cost. Enter 5 different medicines and display the reports



Ms Dos Fundamentals Notes


introduction
 to computers:
Presentation’s URL
  

introduction to network technologies:-
Presentation’s URL



HTML in 15 minits :-

Evolution of computers:

MS-DOS

(Microsoft Disk Operating System)

Micro Soft Disk Operating System shortly we say MS – DOS, developed by Micro Soft Company whose owner is Bill Gates. Ms-Dos is a Single User, Single Tasking Operating system. It supports CUI (Character User Interface) features. Here we will do everything is by using Ms-Dos commands only.

Files & Directories: -

Files:- One of the DOS’s most important jobs is to create and manage the files and directories that your computer uses to do its work. Your computer stores all its information in files. There are two types of files.
  1. Program Files. (also known executable files)
  2. Data Files
The program files contain the instructions needed to run different soft wares. (Programs) The data file contains the information created by the various users. Data files are again classified into two types 1) Normal Files (2) Batch Files.
Dos Files are identified with a file name of eight characters or less, followed by a period (.) and a three characters extension.
Directories: - Directories and sub-directories are the areas that allow you to organize logical groups.

These directors are also called as folders in windows operating system
We are going to use number of commands to utilize the facilities provided by Ms-Dos. These commands are grouped in two categories.
  1. Internal Commands
  2. External Commands
Internal Commands: - Internal commands are the commands which are executed automatically by the computer, without the help of any other files excepting the COMMAND.COM. When the system is booting at that time these commands will automatically loaded.

We should have to apply the commands at prompt place with syntax format otherwise it will display error messages.

Prompt:- Where the system accept the commands that place is called a prompt place.
By default prompt place is C :\> (C prompt).

Syntax: - System can understand commands in a specific format so, we have to follow that format to execute commands. That format is called a syntax format. Each command has its own syntactic format.

a) date b) time c) cls d) dir

(a) Date: - This command is used to display (or) modify the current system date
Syntax: - Date
By default date format is MM-DD-YY. If you want to enter new date, follow the above date format.

(b) Time: - This command is used to display (or) modify the current system time.
Syntax: - Time
By default Time format is HH:MM:S: a/p.

(C) Cls: - This command is used to clear the Screen
Syntax: - Cls
(d) Dir: - This command is used to display the list of files and directors. It also displays the filenames with extension, the size in bytes, date and time of the files created, total number of files and free space available in the disk.
Syntax: - Dir [options]

Options:-

/P Pauses after each screen of information.
/W Uses wide list format.
/S Displays files in specified directory and all subdirectories.
/B Uses bare format (no heading information or summary).
/L Uses lowercase.
/V Verbose mode.
/4 Displays year with 4 digits.
/A Displays files with specified attributes.
/AD Displays Directories Only /AR Displays Read-only files
/AH Displays Hidden files /AS Displays System files
/O List by files in sorted order.
/ON By name (alphabetic Ascending). /O-N By name (alphabetic Descending)
/OS By size (smallest first) /O-S By size (Biggest First)
/OE By extension (alphabetic Ascending) /O-E By Extension (alphabetic Descending)
/OD By date & time (earliest first) /O-D By date & Time (earliest last)


a) copy con b) type c) copy d)ren e) del

(a) Copy Con: - This command is used to create a file.
Syntax: -Copy con
Ex: -Copy con Rama
-- --- --- ---
--- --- --- --
--- -- --
F6 (or) Ctrl +Z

It creates the file with the filename Rama. Type your information and press F6 or Ctrl + Z to save the file.
Rules for giving the file name is
  • The file name must be unique.
  • The file name must be length of 8 characters and it should contain only numerical and alphabets.
(b) Type: - This command is used to display the contents of the specified file.
Syntax: - Type
Ex: - Type Rama

(C) Copy: - This command is used to copy the contents of one file to another file.

This command is also copies files from one location to another location with respective of their location given by the user
Syntax: - Copy
Ex: - Copy Rama sita
The contents of Rama file will be automatically copies in to the file sita.
(d) Ren: - This command is used to change the name of the filename or directory name.
Syntax: -Ren
Ex: -Ren Sita raghu
The name of the filename Sita is automatically changes to the raghu.

(e) Del: - This command is used to delete the file specified by the user. It will ask the conformation before deleting the files.
Syntax: - Del
Ex: - Del raghu
Del/p: - Before deleting the file it will ask prompt (y/n).


a) md b) cd c) cd.. d) cd\ e) rd
(a) MkDir (or) MD : - This command is used to create a new directory.
Syntax:- Md
Ex: - Md Raju
A new directory will be created with the name Raju.

(b) ChDir (or) CD: - This command is used to change from the Current directory to a specified existing directory.
Syntax: - Cd
Ex: - Cd Raju
You will enter in to the directory Raju by using this command and your command prompt is “C:\RAJU>_”

(C)Cd . . : - This command is used to logout from the current directory to its parent directory

Syntax: - cd..

(d) Cd\: - This command is used to logout current directory to root directory i.e. C :\>

Syntax: - cd\


(e) RmDir (or) Rd: - This command is used to delete or remove the specified empty directory. For deleting a directory, that directory must be empty.

Syntax: -Rd

Ex:- Rd Raju
The directory Raju will be deleted by this command.

a) path b) vol c) ver

(a) Path: - This command is used to display the current path which we are using.

Syntax: - Path

It displays the present path of the drive.


(b) Vol: - This command is used to displays the volume label and serial number of the disk.
Syntax: - Vol

(C) Ver: - This command is used to displays version number of operating system that we are using at present.
Syntax: -Ver











EXTERNAL COMMANDS:-

These commands are used for the specific purpose to expand the operating system usefulness. These commands are not loaded when the operating system files are loaded.


a) edit b) attrib c) more
(a) edit: - This command is used to modify the contents of the file.

Syntax: -Edit

Ex: -edit Rama
Blue color editor with cursor blinking will be appeared. In that you can modify your file.

(b) Attrib: - This command is used to sets or removes the attributes (properties) of the files.
The following are some of the attributes of files: -
(1) +R Sets as Read Only file.
Syntax: - Dir +R
Ex:- Dir +R Rama.

(2) –R Clears the Read Only file
Syntax: - Dir -R
Ex: -Dir –R Rama.

(3)+H Sets the File as Hidden file.
Syntax: - Dir +H
Ex: - Dir +H Rama.

(4)-H Clears the file as Hidden file.
Syntax: - Dir –h
Ex: -Dir –H Rama.

(C) More: - This command is used to display one screen full of information at a time.
It is used in the case where the file contents are more than one page.
Syntax: - More
Ex: - more ramu
Ex:- type ramu | more
In the above command “|” is the Pipe Symbol which is used to connect two commands and run simultaneously.
By using this command it displays the contents of the file “Ramu” in page wise.



Exercise-6
a) Help b) tree c) xcopy d) exit

(a) Help: - This command is used to displays the system provided information about that command, which you are giving after the help command.
Syntax: - help
Ex: - help cls


(b) Tree: - This command is used to displays the names of the files in each directory in tree diagrammatic format. It displays the overall structure of the specified directory.
Syntax: - Tree
Ex: - Tree Raju

(C) Xcopy: - This command is used to copy the files from one directory to another directory

Syntax: -Xcopy
Ex: - Xcopy Raju Ravi
All the files of the directory “Raju” are automatically copied to the directory Ravi.

Source: - Specifies the file(s) to copy.
Destination: - Specifies the location and/or name of new files.

/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
/C Continues copying even if errors occur.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/H Copies hidden and system files also.
/U Updates the files that already exist in destination.
/Y Overwrites existing files without prompting.

(d) Exit: - This command is used to come out from the ms-dos operating system.
Syntax: - exit
Ex: - exit.