DBMS Worksheet 1 (8 Files Merged)
DBMS Worksheet 1 (8 Files Merged)
2. Requirements:
3. Description:
d. Output of the clear screen; command depicted in the following snapshot.
Implement 5 commands of Oracle in Run SQL Command Line software.
b. Then enter the username and password. If the password is correct, it will show connected.
e. Use Select * from tab; command to view the system tables.
d. Use to commit command to permanent all the changes made to the database.
Experiment No. – 1.2
3. SQL Commands:
4.Screenshots
5. Result/Output/Writing Summary:
The code runs perfectly also the table is created successfully the changes applied to the table are
seen in the select statement.
4.Screenshots
5. Result/Output/Writing Summary:
The code runs perfectly also the table is created successfully the changes applied to the table are
seen in the select statement.
Learning outcomes (What I have learnt): EXPERIMENT-1.5
1. Learnt to create table using SQL.
Student Name: Garv Kathuria UID: 21BCS5819
2. Learnt to work with select commands with different condition. Branch: AIML Section/Group- 21AIML-4-B
Semester: 3rd Date of Performance:30/09/22
3. Learnt to modify, update and deleted values in a table. Subject Name: Database Management System Subject Code: 21CSH-243
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):
1. Experiment Title/Problem Statement:
Sr. No. Parameters Marks Obtained Maximum Marks
1. To implement the structure of table.
2.
3. 2. Requirements: Oracle express edition 11g software
3. Description-
Data Definition language (DDL)- It consists of the SQL commands that can be
used to define the database schema. It simply deals with descriptions of the database
schema and is used to create and alter the structure of database objects in the
database. It is a set of SQL commands that is used to modify, alter, and delete
database structure or schema.
Truncate command
Drop command
6. Result/Output/Writing Summary:
Rename command:
Comment:
Student Name: Garv Kathuria UID: 21BCS5819 Here, we are implementing all the joins on a pair of tables having single column but the
functionality of join is not limited to two tables or single column only but it can be used
Branch: AIML Section/Group- 21AIML-4-B
with various columns & even more columns.
Semester: 3rd Date of Performance:
Subject Name: Database Management System Subject Code: 21CSH-243 4. Steps for experiment/practical:
1. Create table tab1 and tab2 with 1 column val and insert the values.
2. Perform NON-EQUI join in tab1 and tab2 using != operator.
3. Perform EQUI join in tab1 and tab2 using = operator.
1. Experiment Title/Problem Statement: 4. Perform both right and left outer join in tab1 and tab2 using (+) operator.
5. Create another table student with column name and age and insert values to it.
To implement the concept of joins. 6. Perform greater than operation and grouping the data using age column.
1. EQUI JOIN: This join statement is used for joining two tables with the help of
equality or matching columns, i.e., the equal rows from both of the tables will be
combined. It is also called as Simple Join.
SYNTAX: SELECT <columns> FROM <tbl1>, <tbl2> WHERE tbl1.<col> =
tbl2.<col>;
2. NON-EQUI JOIN: This join relies on relations other than equality ranging from
<, >, <=, >= or !=. It returns the combination for the rows pertaining to the
columns based on the given relation.
SYNTAX: SELECT <col> FROM <tbl1>, <tbl2> WHERE tbl1.col > tbl2.col;
3. OUTER JOIN: It is of two types, right & left. It is a superset of Equi-join which
returns the rows as per simple join along with no matching rows corresponding
to a particular column. It is represented using ‘(+)’ with the table name.
● If the operator is on the left side, then it is RIGHT OUTER JOIN which
results in the extra values from the right table to be taken.
SYNTAX: SELCT * FROM tbl1, tbl2 WHERE tbl1.col1 (+) = tbl2.col2;
● If the operator is on the right side, then it is LEFT OUTER JOIN which
results in the extra values from the left table to be taken.
SYNTAX: SELCT * FROM tbl1, tbl2 WHERE tbl1.col1= tbl2.col2 (+);
NON-EQUI join Outer joins:
EQUI join
3. Description-
GROUP by-The GROUP BY Statement in SQL is used to arrange identical data
into groups with the help of some functions. i.e if a particular column has same
values in different rows then it will arrange these rows in a group.
6. Result/Output/Writing Summary:
HAVING Clause- it enables you to specify conditions that filter which group
The different types of joins present in the SQL were understood & implemented results appear in the results.
successfully in this experiment. The WHERE clause places conditions on the selected columns, whereas the
HAVING clause places conditions on groups created by the GROUP BY clause.
ORDER by- The SQL ORDER BY clause is used to sort the data in ascending or
descending order, based on one or more columns
4. Steps for experiment/practical: Groupby with where and without where
1. Create table tbl2 with 3 column (name, age, marks).
2. Insert values in it
3. Use group by clause with where and without where
4. Use having clause with group by
5. Use order by clause with group by
5. Snapshots of Above steps
6. Result/Output/Writing Summary:
3. Description-
A subquery is a query within another query. The outer query is known as the main query,
and the inner query is known as a subquery.
Subqueries with the Select Statement – SQL subqueries are most frequently used with the
Select statement.
Syntax –
SELECT column_name
FROM table_name
WHERE column_name expression operator
SELECT column_name from table_name WHERE ...);
The list of logical operators in SQL are as follows:
Operator Description
All It compares a value to all values in another value set.
And It allows the existence of multiple conditions in an SQL statement.
Any It compares the values in the list according to the condition.
It is used to search for values that are within a set of values.
Between
In It compares a value to that specified list value.
Not It reverses the meaning of any logical operator.
Or It combines multiple conditions in SQL statements.
Exists It is used to search for the presence of a row in a specified table.
Like It compares a value to similar values using wildcard operator
Student Name: Garv Kathuria UID: 21BCS5819
Branch: AIML Section/Group- 21AIML-4-B
Semester: 3rd Date of Performance:
Subject Name: Database Management System Subject Code: 21CSH-243
3. Description-
Index-Indexes are used to retrieve data from the database more quickly than
otherwise. The users cannot see the indexes, they are just used to speed up
searches/queries.
Cursor- A cursor is a pointer to this context area. PL/SQL controls the context
area through a cursor.
Triggers- Triggers are stored programs, which are automatically executed or fired
when some events occur.
View- A view contains rows and columns, just like a real table. The fields in a
view are fields from one or more real tables in the database.
6. Result/Output/Writing Summary: