0% found this document useful (0 votes)
39 views11 pages

It Practical Session 2

Uploaded by

singhharikesh777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views11 pages

It Practical Session 2

Uploaded by

singhharikesh777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

PRACTICAL (SESSION-2)

 START THE RDBMS AND OBSERVE THE PARTS OF


THE MAIN WINDOW –
Firstly, start the desired RDBMS software, and go to its main
window.

 IDENTIFY THE DATABASE OBJECTS-


To identify the various database objects, we will observe the
above image.

After observing the Main Window and the various tables


created, we can see various parts of the database which are-

1. Tables:

 Definition: Structured collections of data organized into rows


and columns.
 Purpose: Store data in a relational format, where each row
represents a record, and each column represents a field within
the record.

2. Views:

 Definition: Virtual tables created by querying one or more


tables.
 Purpose: Simplify complex queries, provide a level of security
by restricting access to specific data, and present data in a
specific format without storing it physically.

3. Indexes:

 Definition: Structures that improve the speed of data retrieval


operations on a table.
 Purpose: Enhance query performance by allowing the DBMS to
find data quickly without scanning the entire table.

4. Stored Procedures:

 Definition: Precompiled collections of one or more SQL


statements stored under a name and processed as a unit.
 Purpose: Automate repetitive tasks, enforce business rules, and
improve performance by reducing the amount of
communication between applications and the database.

5. Functions:

 Definition: Similar to stored procedures but return a single


value and can be used in SQL expressions.
 Purpose: Perform calculations, manipulate data, and enforce
business logic.

6. Triggers:
 Definition: SQL code that automatically executes in response to
certain events on a particular table or view (e.g., insert, update,
delete).
 Purpose: Enforce data integrity, audit changes, and implement
complex business rules.

7. Sequences:

 Definition: Objects that generate a sequence of unique


numeric values.
 Purpose: Provide unique identifiers for rows in tables,
especially useful for primary keys.

8. Synonyms:

 Definition: Aliases for database objects like tables, views,


sequences, or other synonyms.
 Purpose: Simplify access to database objects and provide a
layer of abstraction.

9. Schemas:

 Definition: Logical containers that group database objects.


 Purpose: Organize and manage database objects, providing a
way to control access and maintain logical separation.

10. Constraints:

 Definition: Rules enforced on data columns in tables.


 Types:
o Primary Key: Ensures each row in a table has a unique
identifier.
o Foreign Key: Enforces referential integrity between
tables.
o Unique: Ensures all values in a column are unique.
o Check: Ensures that all values in a column meet a specific
condition.
o Not Null: Ensures that a column cannot have NULL values.

11. User-Defined Types (UDTs):

 Definition: Custom data types defined by the user to


encapsulate and enforce specific business rules.
 Purpose: Extend the DBMS's native data types to better model
the data used in an application.

12. Materialized Views:

 Definition: Physical copies of data retrieved by a query.


 Purpose: Improve query performance by storing the results of a
complex query and refreshing them periodically.

 CREATE THE SAMPLE TABLE IN ANY CATEGORY


USING WIZARD, PRACTICE TO CREATE DIFFERENT
TABLES FROM THE AVAILABLE LIST AND CHOOSING
FIELDS FROM THE AVAILABLE FIELDS-
To create a table through Wizard, First of all,

1. Go to the ‘USE WIZARD TO CREATE TABLE……’ option and


click on it. (as shown in the image)
2. After clicking on the wizard option, a new dialog box will
appear on our screen i.e. Table Wizard dialog box, in this
dialog box we will make/customize our table step-by-step.
FIRST STEP- Select Fields for the Table.

SECOND STEP- Now, Set the Field Types and Formats of your table.
THIRD STEP After setting the field types, Set the Primary Key of your
table.

FOURTH STEP- Lastly, Click on the Finish button to create your table.
After clicking on the Finish Button, A Table Data View window will
appear showing our created table.

We can observe in the above that the Field Types that we have
selected in the second step are being displayed there, and the Contact
ID is shown as the Primary Key, which we have performed in the third
step.

 EDIT THE TABLE IN THE DESIGN VIEW, AND ENTER


THE DATA IN THE FIELDS.
To edit a table in the Design View, First, Go to the table that
you want to edit.
1. Right-click on the table, and press the Edit option
from the dialog box.

2. Now the Table Design window will be appear, in


which we can edit our table.
 CREATE AND ADD TABLE USING DDL
COMMANDS-
For creating and adding tables using DDL (in Open Office
Base)-

1. First of all, Open the SQL Command Window.


2. Now, Write the commands for creating a table and press
the Execute button

4. After pressing the Execute button, ‘command executed


successfully’ will be displayed in the Status block.
5. Now, to view the table made through the DDL commands, Go to
View and press the Refresh Tables option, and go to Tables, now we
can see the Table name ‘CUSTOMERS’.

6. Click on the table ‘CUSTOMERS’, now we can see the table that we
have made through DDL COMMANDS.

You might also like