0% found this document useful (0 votes)
3 views

Oracle-1

The document provides an introduction to database management systems (DBMS), relational database management systems (RDBMS), and SQL, detailing Oracle Corporation's history and significance. It explains key concepts such as data, information, databases, tables, relationships, and SQL commands, including their types and functionalities. Additionally, it outlines the differences between SQL and SQL*Plus, as well as various SQL operators and data types used in Oracle.

Uploaded by

hirenheckar55
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Oracle-1

The document provides an introduction to database management systems (DBMS), relational database management systems (RDBMS), and SQL, detailing Oracle Corporation's history and significance. It explains key concepts such as data, information, databases, tables, relationships, and SQL commands, including their types and functionalities. Additionally, it outlines the differences between SQL and SQL*Plus, as well as various SQL operators and data types used in Oracle.

Uploaded by

hirenheckar55
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Ch-1 :- introduction of dbms,rdbms & sql.

14 marks

Q- Intrduction of oracle:

- Oracle corporation is an american multinational company


- Headquartered of oracle corporation is in redwood city,
california (usa).
- The company sells database software and technology.
- Oracle was found in june/16/1977 by larry ellison, bob miner.
- Oracle is the second-largest software company by
revenue and market capitalization after microsoft.
- Total number of employees are 136,000 (2019).
Q- What is information?(1
marks) Ans:-
- Meaning full data is called information.

Q- what is data?(1 marks)

- Data is raw material ,any information inputed into computer


is called data.
Q- what is data base?
collection of tables is called data base.

Q- what is table?
- Table is collection of raw and column.

Q- Difference between dbms and rdbms(m.imp 5)

Dbms Rdbms
Database management system Relational data base mangement
system.
In dbms relationship between two In rdbms relationship between two
table or file are maintain by program tables or file can create at the time of
table creation.
Dmbs does not support client and Rdbms support client and server
server model. moel
Dbms there is no security of data. In rdbms there are multi level of
security of data.
Each table given extension Many tables are in one data base.
Dbms satisfied less then 7 rules of It satisfied more then 7 reules of
dr.e.f codd rules dr.ef codd.
Q- explain relationship in detail.(3marks imp)

- It is way to define relation between number of tables.


- There are three types of relationship available like
1) One to one relationship
2) One to many relationship
3) Many to many relationship.
1) One to one relationship:-
- One to one relationship is,one field of first table
is connected only one field of second table.
1) One to many relationship:-

- One field of first table is connectd with many field of second


table is called one to many relationship.
table-1 table-2
No No
Name Name
City City
State State

2) Many to many relationship


- Many to many realtionship is one or more field of first table
is connect to the one or more field of second table.

Q- Explain e-r diagram in detail(3 marks)

- Er means entity relationship diagram.


- Diagram are one of the better way to communicate
different components of system.
- They are also easy to understand by everyone.
- They provide overview of entire system.
- E-r diagram is graphical method to represent relationship
between tables.
- E-r diagram use different system.
1) Rectangle display entity (table name)
2) It is used to display relation ship between table.
3) Ovel shape display attribute.(table field )
Q- Explain dr.e.f.codd rules.(3marks imp)
- Dr.e.f. codd is ibm reaseacher.
- Who first developed the relation database model in 1970.
- In 1985 dr.e.f.codd published the list of 12 rules that define
any software is dbms or rdbs.
- Here we can explain some important rules of dr.e.f. codd.
1) The information rule:-
- All the data should be presented in table form.

2) Guarantee access rule:-


- All the data should be access easily.

3) Systematic treatment of null value:


- A field should be allowed null which is diferent from zero.
- This can not apply primary key.
4) View update rule:-
- each view support the same range of data manipulation that
has direct access to a table available.
5) High level insert,update,delete:-
- It support high level insert,update and delete. Records of tables.
6) Physical data indepandence:-
- User should remain isolated from the physical method of
store and retrive data from the data base.
7) Logical data independence
- How data is view should not be change when the logical
structure of the data base is changed.

Q-10 what is sql?

- Sql is known is language of database.


- Sql is stand for structured query language.
- Sql is used to communicate with data base.
- Sql developed by ibm in 1970.
- It is standard language used to interact with modern data base.
- Sql is an english like language and it has simple command
set which is esy to remember.
- Sql statement are used to perform task such as insert, update
and delete the data.
- Sql can used by numbers of user,including those with little of
no programming experience.

Q- Explain sql* plus(1 mark)

- Sql * plus is oracle product.


- It provide command window,where sql command can be
written by the user.
EXPLAIN SQL COMMAND.

There are four types of SQL command.


1) DDL (Data Definition Language)
2) DML (Data Manipulation Language)
3) DCL (Data Control Language)
4) DQL (Data Query Language)

DETAILING:-

1) DDL :
DDL contains following commands or statements.
CREATE: It is used to create objects (table, view, function, procedure, trigger
etc) in the database.
ALETER: It is used to change the structure of database.
DROP: It is used to delete objects from the database.
TRUNCATE: It is used to remove all records from the table, including all
spaces allocated for the records are removed.
GRANT: It is used to give different command grant (access rights) to the user.
REVOKE: It is used to take the given grant back from the user.

2) DML:
DML contains following commands or statements.
INSERT: it used to insert the data into a table.
UPDATE: it used to update the existing data within a table.
DELETE: it used to delete all the records from the table, the space will be
remaining.
e CALL: it is used to call a PL/SQL program.

3) DCL:
e DCL contains following commands or statements.
e COMMIT: it is used to save the work.
e SAVEPOINT: it is used to identify a point in transaction.
e ROLLBACK: Restore database to original since the last commit (like undo).

4) DQL:
e DQL contain only one statement.
e SELECT: It is used to retrieve data from the database.

ONE WORD QUESTION ANSWER

SR.NO QUESTION ANSWER


1. HOW MANY TYPES OF SQL 4
COMMANDS?
2 GIVE NAME THE NAME OF DDL,DCL,DQL,DML.
SQL COMMAND

5 DQL MEANS DATA QUERY LANGUAGE

Q- EXPLAIN DATATYPE OF SQL/ORALCE.

CHAR, VARCHAR,VARCAHR2,DATE,NUMBER,LONG,RAW

LONG DETAILING:-

SQL has following data types.


1) CHAR:
Syntax: <column name> CHAR (<size>)
User can enter only character if you specify column with this data
type. It is fixed length character string.
Example: name CHAR (10)
Now user can enter 10 alphabetic characters into name column.
Maximum size of this data type is 255.

2) VARCHAR:
Syntax: <column name> VARCHAR (<size>)
User can enter both character and numeric value if you specify column with
this data type.
It is variable length character string.
Example: name VARCHAR (10)
Now user can enter 10 alphanumeric digits into name column.
Maximum size of this data type is 2000 characters.

3) VARCHAR2:

Syntax: <column name> VARCHAR2 (<size>)


User can enter both character and numeric value if you specify column with
this data type.
It is variable length character string.
Example: name VARCHAR (10)
Maximum size of this data type is 4000 characters.
4) DATE:
Syntax: <column name> DATE
This data type is used to represent data and time.
The standard format is DD-MON-YY.
Example: DOB date
Now user can enter date into DOB column.
5) NUMBER(P,S):
Syntax: <column name> NUMBER (P, S)
The number data type is used to store numbers (fixed or floating point).
The P (precision) determines the maximum length of the data, whereas
the scale determines the number of places to the right of the decimal.
If the scale is omitted then the default is zero.
The maximum length of this data type is 38 digits with Precision and scale.
Example: mob NUMBER (10)

Now user can enter maximum 10 digits into mob column.

6) LONG:
Syntax <column name> LONG
This data type is used to store variable length character strings containing up
to 2GB.
Only one long value can be defined per table.
Long values cannot be used in sub queries, functions, and expressions.
Example: image LONG

7) RAW/RAW LONG:
Syntax: <column name> RAW
<Column name> RAW LONG
This data type is used to store binary data, such as picture or images.

The size of RAW data type is 255 bytes.


The size of RAW LONG data type is 2 GB.

ONE WORD QUESTION ANSWER

SR.NO QUESTION ANSWER


1. HOW MANY TYPES OF DATA 7
TYPES IN ORACLE ?
2 CHAR MEANS CHARACTER

3 SIZE OF VARCHAR DATA TYPE 2000CHAR


4 SIZE OF VARCAHR2 DATA 4000 CHAR
TYPE
5 WHICH DATA TYPE CAN USE LONG
ONLY ONE TIME PER TABLE?
6 SIZE OF NUMBER DATA TYPE 38 DIGIT WITH P& S
Q- DIFFERENCE BETWEEN SQL AND SQL
*PLUS. DETAILING:-

ONE WORD QUESTION ANSWER

SQL SQL *PLUS


SQL is a language SQL *Plus is an environment
SQL is created as per the ANSI standards. SQL *Plus is ORACLE proprietary
SQL keywords can not be abbreviated. SQL *Plus keywords can be abbreviated.
SQL Statements manipulate data and SQL *Plus commands do not allow
table definitions in the database. manipulation of values in the database.
SQL statements are passes to SQL Buffer. SQL *Plus commands are not passes to
SQL Buffer.
SQL SQL SQL *Plus SQL
Statement Buffer Command Buffer

SR.NO QUESTION ANSWER


1. SQL MEANS STRUCTURE QUERY
LANGUAGE

2 SQL IS LANGUAGE? YES

3 SQL *PLUS MEANS TOOLS.


4 CAN SQL RUN WITH USE OF YES
ORACEL ENGINE?
5 SQL* PLUS IS ORALCE TOOL.

Q- EXPLAIN SQL *PLUS FORMATTING COMMAND.


ANS:
SQI *PLUS HAS 10 SIMPLE COMMANDS.

DETAILING:-
e SPOOL <filename>:
This allows saving SQL statements together with their outputs to a
file.

e SAVE <filename>: This allows you to save buffer contents into a file.

e DESCRIBE <table name>: Lists the attributes of tables and other objects.
The command also can be written as DESC <table name>.

e EDIT [filename]: Places you in an editor so you can edit a SQL command.
The command also can be written as ED [filename].
e EXIT or QUIT : Disconnect from the database and terminate SQL*Plus
e SET SERVEROUTPUT {OFF|ON}: Whether to display the output of
stored procedures (or PL/SQL blocks). By default OFF.

e SET AUTOCOMMIT {OFF|ON}: Commits after each SQL command or


PL/SQL block automatically. By Default OFF.

Ø SET COLSEP { |text} : The text to be printed between columns retrieved by SELECT
statement. Columns normally separated by a space.

SET SQLPROMPT {SQL|Text}: Sets the SQL*Plus command prompt.


Example:
SQL> SET SQLPROMPT ‘HNS’;
Above command will change the prompt to
HNS>

ONE WORD QUESTION ANSWER

SR.NO QUESTION ANSWER


1. SPOOL MEANS SPOOLING

2 DESC MEANS DISPLAY STURCUTRE

3 COMMIT MEANS SAVE WORK


4 AUTO COMMIT MEANS ORACLE ENGINE SAVE
WORK AUTOMATICALLY
5 COLSEP MENS COLUMN SEPARATOR
Q- EXPLAIN SQL OPERATOR.
ANS: IT HAS FOUR OPERATORS LIKE

ARITHMETIC COMPARISIO LOGICAL NEGATE


Operator is used with SQL statement in where clause.
SQL has following operator:
1. Arithmetic Operator. 2. Comparison Operator.
3. Logical Operator. 4. Negate Operator.

ARITHMETIC OPERATOR

Assume a = 10, b = 20;


Operator Description Example
+ Addition a + b ANS is 30
- Subtraction a – b ANS is -10
* Multiplication a * b ANS is 200
/ Division b/a ANS is 2
% Modulus b%a ANS is 0

Comparison Operator:

Assume a = 10 and b = 20

Operator Description Example


= If a = b then returns true False
!=, <> If a!=b or a<>b then returns true True
> If a > b then returns true False
< If a < b then returns true True
>= If a >= b then returns true False
<= If a <= b then returns true True
!> If a!> b then returns true True
!< If a!< b then returns true False

Logical Operator:

Operator Description
AND This operator is used to provide multiple conditions in SQL
statements.
Both conditions must be true.
OR This operator is used to provide multiple Conditions in SQL
statements.
Either one or all condition may be true.
BETWEEN This operator is used to search values between max and minimum
values.
EXISTS This operator is used to search for the presence of a row in a
specified table.
LIKE This operator is used to compare a string value.
IN This operator is used to compare value from a given list.
IS NULL This operator is used to check the null value.
Negate operator:

Operator Description
NOT This operator reverses the meanings of the logical operator with
which it is used.
For ex. NOT EXISTS, NOT BETWEEN, NOT IN etc.

ONE WORD QUESTION ANSWER

SR.NO QUESTION ANSWER


1. HOW MANY TYPES OF 4
OPERATOR ARE
AVAILABLE
IN ORACLE
2 NEGATE MEANS NEGATIVE OR NOT

3 AND OPERATION HOW BOTH


MANY CONDITION ARE
TRUE
?
4 IN OR OPERATOR HOW ONE
MANY CONDITION ARE TURE
5 NEGATE MEANS? OPPOSITE OF LOGICAL
OPERATOR

You might also like