0% found this document useful (0 votes)
26 views32 pages

RDBMS Labfile

This document provides information on a Relational Database Management System (RDBMS) course including its vision, mission, program outcomes, and course details. The vision is to educate students to take on global challenges as ethical citizens and the mission is to impart holistic and outcome-based education. The document outlines the program outcomes, program specific outcomes, Bloom's taxonomy levels, and details of the course labs which involve exploring database concepts, SQL queries, and database development and management.

Uploaded by

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

RDBMS Labfile

This document provides information on a Relational Database Management System (RDBMS) course including its vision, mission, program outcomes, and course details. The vision is to educate students to take on global challenges as ethical citizens and the mission is to impart holistic and outcome-based education. The document outlines the program outcomes, program specific outcomes, Bloom's taxonomy levels, and details of the course labs which involve exploring database concepts, SQL queries, and database development and management.

Uploaded by

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

RDBMS

CSH216B-T&P

BBA FAA 4th sem


MANAV RACHNA UNIVERSITY

Vision

To educate students in frontier areas of knowledge enabling them to take up challenges as ethical and
responsible global citizens

Mission

· To impart outcome based holistic education


· To disseminate education in frontier areas
· To produce globally competitive, ethical and socially responsible human resources
· To produce human resources sensitive to issues of Environment and Sustainable
Development
· To develop Environment and Sustainable development as a thrust area of research and
development.
MANAV RACHNA UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE AND TECHNOLOGY

Vision

To be a quality conscious, research centric and change oriented technological leader in


the relevant areas.

Mission
· To develop and impart knowledge and skills in the field of Computer Science
and Engineering.
· To focus on new techniques, tools and technology, in ethical and responsible
manner.
· To encourage and support the generation and implementation of innovative
ideas.
· To carry out collaborative inter-disciplinary Academic and Research activities.
· To create employment-ready human resources.

Programme Specific Outcomes (PSOs)

PSO1:    Attain the ability to design and develop computer programs and possess acquaintance with emerging
technologies and open source platforms in the area of mobile app development, artificial intelligence, machine
learning, web development, data analytics, cloud computing and networking to build effective computer-based
systems
PSO2:  Acquire technical competency to deliver computer based innovative and effective solutions to tackle
business and societal challenges, for pursuing successful career, entrepreneurship, research and higher studies.
Bloom’s Taxonomy (BTs)

BT1- Knowledge: Knowledge involves recognizing or remembering facts, terms, basic concepts, or answers
without necessarily understanding what they mean.
BT2-Comprehension: Comprehension involves demonstrating understanding of facts and ideas by
organizing, comparing, translating, interpreting, giving descriptions, and stating the main ideas.
BT3-Applications: Applying involves using acquired knowledge—solving problems in new situations by
applying acquired knowledge, facts, techniques and rules. Learners should be able to use prior knowledge to
solve problems, identify connections and relationships and how they apply in new situations.
BT4-Analysis: Analyzing involves examining and breaking information into component parts, determining
how the parts relate to one another, identifying motives or causes, making inferences, and finding evidence to
support generalizations.
BT5-Synthesis: Synthesizing involves building a structure or pattern from diverse elements; it also refers to
the act of putting parts together to form a whole.
BT6-Evaluation: Evaluating involves presenting and defending opinions by making judgments about
information, the validity of ideas, or quality of work based on a set of criteria.

Program Outcomes (POs)
PO1: Ability to Apply knowledge of management theories and practices to solve business problems.
PO2: Demonstrate foundational knowledge of the functional areas of business
PO3: Foster Analytical and critical thinking abilities for data-based decision making in Organizational Context
PO4: Ability to use appropriate decision support tools.
PO5: Contribute to knowledge Creation
PO6: Ability to understand, analyze and communicate regional, national, global economic, legaland Ethical aspects of
business.
PO7: Ability to work effectively in a team situation.
PO8: Ability to demonstrate specialized knowledge and competencies in their area.
PO9: Ability to write and orally present ideas effectively in business English.
PO10: Demonstrate sensitivity to societal needs and issues

PSO 1: Disciplinary knowledge: Capable of demonstrating comprehensive knowledge and understanding of


finance and accounts.
PSO 2: Communication Skills: Ability to read and write analytically, and present financial information in a
clear and concise manner.
PSO 3: Critical thinking: Ability to critically evaluate financial practices to implement in managerial decision
making.
PSO 4: Problem-solving: Ability to apply financial concepts to financial consulting in corporate finance
(M&A, IPO, Share and Debt Issues).
PSO 5: Analytical reasoning: Ability to analyze and synthesize financial data from a variety of sources
PSO 6: Professionalism: Ability to develop competency in the management accounting area and financial
consultancy.

INDEX

S No. List of Practicals


1. Study of Database concepts, simple file system,
Components of DBMS
2. Introduction to Relational Database Management System, SQL
3. Introduction to DDL, DML, DCL queries.

4. Installation of SQL Server, Hands on training on SQL Server environment,


To explore “Create” “Insert” clause using SQL
5. To explore “SELECT” clause using where clause

6. To explore “SELECT” clause using where, order by, between, like, group by,
having
etc.
7. Creating queries with DML commands, Operators
8. Creating and updating Table Views
9. Introduction SQL Report writing tool
10. Introduction to PL/SQL

11. Revision

Course Blooms Program


LAB no. Laboratory Outcome Taxonomy Outcome
1 Study of Database PO3,PO5
concepts, simple file CO1 BT1, BT2
system, Components of
DBMS
2 Introduction to PO4
Relational CO1 BT2
Database
Management
System, SQL
3 Introduction PO4
to DDL, CO1 BT1, BT2
DML, DCL
queries.
4 Installation of SQL PO4, PO5
CO1 BT2
Server, Hands on
training on SQL
Server environment,
To explore “Create”
“Insert” clause using
SQL
5 To explore “SELECT” PO4, PO5, PO3
clause using where CO1 BT1, BT2
clause
6 To explore “SELECT” PO4, PO5, PO3
clause using where, CO2 BT2,BT3
order by, between, like,
group by, having
etc.
7 Creating queries with BT1, BT2 PO4
DML commands,
Operators
8 Creating and updating BT1, BT2 PO4, PO5, PO3
Table Views
9 Introduction SQL PO3,PO4, PO5,
CO2 BT1, BT2,BT3 PO9
Report writing tool
10 Introduction to BT1, BT2 PO3,PO4, PO5
PL/SQL
11 Revision
Lab-1

A) Introduction to type of data

By an estimate, around 90% of the world’s data has been created in the last two years
alone. Moreover, 80% of the data is unstructured or available in widely varying structures,
which are difficult to analyze.
As IT systems are being developed, it has been observed that structured formats like
databases have some limitations with respect to handling large quantities of data.
It has also been observed that it is difficult to integrate information distributed across
multiple systems.
Further, most business users do not know what should be analyzed and discover
requirements only during the development of IT systems. As data has grown, so have ‘data
lakes’ within enterprises.
Potentially valuable data for varied systems such as Enterprise Resource Planning or ERP
(and Supply Chain Management or SCM (read as S-C-M) are either dormant or discarded. It
is often too expensive to integrate large volumes of unstructured data.
The data in it will be of three types.
● Structured data −Relationaldata.
● Semi Structured data −XMLdata.
● Unstructured data −Word, PDF, Text, MediaLogs.

LAB 2
Introduction to Relational Database Management
System, SQL
SQL
o SQL stands for Structured Query Language. It is used for storing and managing data in
relational database management system (RDMS).
o It is a standard language for Relational Database System. It enables a user to create, read,
update and delete relational databases and tables.
o All the RDBMS like MySQL, Informix, Oracle, MS Access and SQL Server use SQL as their
standard database language.
o SQL allows users to query the database in a number of ways, using English-like statements.

Rules:
SQL follows the following rules:
o Structure query language is not case sensitive. Generally, keywords of SQL are written in
uppercase.
o Statements of SQL are dependent on text lines. We can use a single SQL statement on one or
multiple text line.
o Using the SQL statements, you can perform most of the actions in a database.
o SQL depends on tuple relational calculus and relational algebra.

SQL process:
o When an SQL command is executing for any RDBMS, then the system figure out the best way
to carry out the request and the SQL engine determines that how to interpret the task.
o In the process, various components are included. These components can be optimization
Engine, Query engine, Query dispatcher, classic, etc.
o All the non-SQL queries are handled by the classic query engine, but SQL query engine won't
handle logical files.

Characteristics of SQL
o SQL is easy to learn.
o SQL is used to access data from relational database management systems.
o SQL can execute queries against the database.
o SQL is used to describe the data.
o SQL is used to define the data in the database and manipulate it when needed.
o SQL is used to create and drop the database and table.
o SQL is used to create a view, stored procedure, function in a database.
o SQL allows users to set permissions on tables, procedures, and views.

SQL Datatype
o SQL Datatype is used to define the values that a column can contain.
o Every column is required to have a name and data type in the database table.

Datatype of SQL:
LAB 3
Introduction to DDL, DML, DCL queries.

SQL Commands
o SQL commands are instructions. It is used to communicate with the database. It is also used
to perform specific tasks, functions, and queries of data.
o SQL can perform various tasks like create a table, add data to tables, drop the table, modify
the table, set permission for users.

Types of SQL Commands


There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL. TRUNCATE
1. Data Definition Language (DDL)
o DDL changes the structure of the table like creating a table, deleting a table, altering a table,
etc.
o All the command of DDL are auto-committed that means it permanently save all the changes
in the database.

Here are some commands that come under DDL:

o CREATE
o ALTER
o DROP

a. CREATE It is used to create a new table in the database.

1. CREATE TABLE TABLE_NAME (COLUMN_NAME DATATYPES[,....]);  

Example:

1. CREATE TABLE EMPLOYEE(Name VARCHAR2(20), Email VARCHAR2(100), DOB DATE);  
b. DROP: It is used to delete both the structure and record stored in the table.

Syntax

1. DROP TABLE table_name;  

Example

1. DROP TABLE EMPLOYEE;  

c. ALTER: It is used to alter the structure of the database. This change could be either to
modify the characteristics of an existing attribute or probably to add a new attribute.

Syntax:

To add a new column in the table

1. ALTER TABLE table_name ADD column_name COLUMN-definition;   

1. ALTER TABLE table_name MODIFY(column_definitions....);  

EXAMPLE

1. ALTER TABLE STU_DETAILS ADD(ADDRESS VARCHAR2(20));  
2. ALTER TABLE STU_DETAILS MODIFY (NAME VARCHAR2(20));  

d. TRUNCATE: It is used to delete all the rows from the table and free the space containing
the table.

Syntax:

1. TRUNCATE TABLE table_name;  

Prerequisites

The following requirements should be available in your system to work with MySQL:

o MySQL Setup Software


o Microsoft .NET Framework 4.5.2
o Microsoft Visual C++ Redistributable for Visual Studio 2019
o RAM 4 GB (6 GB recommended)
LAB 4
Installation of mySQL Server
Step 1: Go to the official website of MySQL and download the community server edition
software. Here, you will see the option to choose the Operating System, such as Windows.

Step 2: Next, there are two options available to download the setup. Choose the version
number for the MySQL community server, which you want. If you have good internet
connectivity, then choose the mysql-installer-web-community. Otherwise, choose the other
one.

Installing MySQL on Windows


Step 1: After downloading the setup, unzip it anywhere and double click the
MSI installer .exe file. It will give the following screen:

Step 2: In the next wizard, choose the Setup Type. There are several types available, and
you need to choose the appropriate option to install MySQL product and features. Here, we
are going to select the Full option and click on the Next button.
This option will install the following things: MySQL Server, MySQL Shell, MySQL
Router, MySQL Workbench, MySQL Connectors, documentation, samples and examples, and
many more.

Step 3: Once we click on the Next button, it may give information about some features that
may fail to install on your system due to a lack of requirements. We can resolve them by
clicking on the Execute button that will install all requirements automatically or can skip
them. Now, click on the Next button.
Step 4: In the next wizard, we will see a dialog box that asks for our confirmation of a few
products not getting installed. Here, we have to click on the Yes button.

After clicking on the Yes button, we will see the list of the products which are going to be
installed. So, if we need all products, click on the Execute button.
Step 5: Once we click on the Execute button, it will download and install all the products.
After completing the installation, click on the Next button.

Step 6: In the next wizard, we need to configure the MySQL Server and Router. Here, I am
not going to configure the Router because there is no need to use it with MySQL. We are
going to show you how to configure the server only. Now, click on the Next button.
Step 7: As soon as you will click on the Next button, you can see the screen below. Here, we
have to configure the MySQL Server. Now, choose the Standalone MySQL Server/Classic
MySQL Replication option and click on Next. Here, you can also choose the InnoDB Cluster
based on your needs.
Step 8: In the next screen, the system will ask you to choose the Config Type and other
connectivity options. Here, we are going to select the Config Type as 'Development
Machine' and Connectivity as TCP/IP, and Port Number is 3306, then click on Next.

Step 9: Now, select the Authentication Method and click on Next. Here, I am going to select
the first option.
Step 10: The next screen will ask you to mention the MySQL Root Password. After filling the
password details, click on the Next button.
Step 11: The next screen will ask you to configure the Windows Service to start the server.
Keep the default setup and click on the Next button.

Step 12: In the next wizard, the system will ask you to apply the Server Configuration. If you
agree with this configuration, click on the Execute button.
Step 13: Once the configuration has completed, you will get the screen below. Now, click
on the Finish button to continue.
Step 14: In the next screen, you can see that the Product Configuration is completed. Keep
the default setting and click on the Next-> Finish button to complete the MySQL package
installation.

Step 15: In the next wizard, we can choose to configure the Router. So click on Next->Finish
and then click the Next button.
Step 16: In the next wizard, we will see the Connect to Server option. Here, we have to
mention the root password, which we had set in the previous steps.

In this screen, it is also required to check about the connection is successful or not by
clicking on the Check button. If the connection is successful, click on the Execute button.
Now, the configuration is complete, click on Next.

Step 17: In the next wizard, select the applied configurations and click on the Execute
button.
Step 18: After completing the above step, we will get the following screen. Here, click on
the Finish button.

Step 19: Now, the MySQL installation is complete. Click on the Finish button.
Verify MySQL installation
Once MySQL has been successfully installed, the base tables have been initialized, and the
server has been started, you can verify its working via some simple tests.

LAB 5
To explore “SELECT” clause using where clause
Data Query Language
DQL is used to fetch the data from the database.

It uses only one command:

o SELECT

a. SELECT: This is the same as the projection operation of relational algebra. It is used to


select the attribute based on the condition described by WHERE clause.

Syntax:

1. SELECT expressions    
2. FROM TABLES    
3. WHERE conditions;  
For example:

1. SELECT emp_name  
2. FROM employee  
3. WHERE age > 20;  

LAB 6
To explore “SELECT” clause using where, order by, between,
like, group by, having and Logical operators

SQL Operator
There are various types of SQL operator:

SQL Arithmetic Operators


Let's assume 'variable a' and 'variable b'. Here, 'a' contains 20 and 'b' contains 10.

Operato Description Example


r

+ It adds the value of both operands. a+b will give


30

- It is used to subtract the right-hand operand from the left-hand a-b will give
operand. 10

* It is used to multiply the value of both operands. a*b will give


200

/ It is used to divide the left-hand operand by the right-hand a/b will give 2
operand.

% It is used to divide the left-hand operand by the right-hand a%b will give
operand and returns reminder. 0

SQL Comparison Operators:


Let's assume 'variable a' and 'variable b'. Here, 'a' contains 20 and 'b' contains 10.

LAB 7
Creating queries with DML commands,
Operators

Data Manipulation Language


o DML commands are used to modify the database. It is responsible for all form of changes in
the database.
o The command of DML is not auto-committed that means it can't permanently save all the
changes in the database. They can be rollback.

Here are some commands that come under DML:

o INSERT
o UPDATE
o DELETE

a. INSERT: The INSERT statement is a SQL query. It is used to insert data into the row of a
table.
Syntax:

1. INSERT INTO TABLE_NAME    
2. (col1, col2, col3,.... col N)  
3. VALUES (value1, value2, value3, .... valueN);  

UPDATE: This command is used to update or modify the value of a column in the table.

Syntax:

1. UPDATE table_name SET [column_name1= value1,...column_nameN = valueN] [WHERE CON
DITION]   

For example:

1. UPDATE students    
2. SET User_Name = 'Sonoo'    
3. WHERE Student_Id = '3'  

DELETE: It is used to remove one or more row from a table.

Syntax:

1. DELETE FROM table_name [WHERE condition];  

SQL Table
o SQL Table is a collection of data which is organized in terms of rows and columns. In DBMS,
the table is known as relation and row as a tuple.
o Table is a simple form of data storage. A table is also considered as a convenient
representation of relations.

Let's see an example of the EMPLOYEE table:

EMP_ID EMP_NAME CITY PHONE_NO

1 Kristen Washington 7289201223

2 Anna Franklin 9378282882

3 Jackson Bristol 9264783838


4 Kellan California 7254728346

5 Ashley Hawaii 9638482678

In the above table, "EMPLOYEE" is the table name, "EMP_ID", "EMP_NAME", "CITY",
"PHONE_NO" are the column names. The combination of data of multiple columns forms a
row, e.g., 1, "Kristen", "Washington" and 7289201223 are the data of one row

Operation on Table
1. Create table
2. Drop table
3. Delete table
4. Rename table
LAB 8
Creating and updating Table Views

SQL CREATE VIEW Statement


In SQL, a view is a virtual table based on the result-set of an SQL statement.

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.

You can add SQL statements and functions to a view and present the data as if the
data were coming from one single table.

A view is created with the CREATE VIEW statement. 

CREATE VIEW Syntax SQL CREATE VIEW Examples


The following SQL creates a view that shows all customers from Brazil:

CREATE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name
WHERE condition;
CREATE VIEW [Brazil Customers] AS
SELECT CustomerName, ContactName
FROM Customers
WHERE Country = 'Brazil';

SQL Updating a View

A view can be updated with the CREATE OR REPLACE VIEW statement.

SQL CREATE OR REPLACE VIEW Syntax


CREATE OR REPLACE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name
WHERE condition;

The following SQL adds the "City" column to  the "Brazil Customers" view:

Example
CREATE OR REPLACE VIEW [Brazil Customers] AS
SELECT CustomerName, ContactName, City
FROM Customers
WHERE Country = 'Brazil';
LAB 9
Introduction SQL Report writing tool
he following table lists the available tools for administering the report server that is
deployed in native mode.

Tool Description How to


access
Report Server Use this tool to configure a Reporting Services Start menu
Configuration installation. Available tasks include:
Manager
Configuring the Report Server service account.

Creating and configuring one or more Web


service URL.

Configuring the web portal URL

Creating and configuring the report server


database.

Configuring a scale-out deployment.

Backup, restoring, or replacing the symmetric


key that is used to encrypt stored connection
strings and credentials.

Configuring the unattended execution account.

Configuring Subscription settings.

Configuring an SMTP server for e-mail delivery.

Configuring the Power BI Service (cloud).

Note: The Report Server Configuration Manager


does not help you manage report server content,
enable additional features, or grant access to the
server.

For more information, see Report Server


Configuration Manager (Native Mode).
SQL Server Use this tool to manage one or more report Start menu
Management Studio server instances in a single environment,
including:

Managing both local and remote report server


instances

Setting report server properties

Modifying role definitions


Tool Description How to
access

Turning off report server features you are not


using

Managing jobs

Managing shared schedules


Rsconfig Utility Use this tool to configure and manage a report Command
server connection to the report server database. prompt
You can also use it to specify a user account to
use for unattended report processing.

For more information, see Report Server


Command Prompt Utilities (SSRS).
Rskeymgmt Utility Use this tool to: Command
prompt
Extract, restore, create, and delete the symmetric
key used to encrypt report server data

Join report server instances in a scale-out


deployment

For more information, see Report Server


Command Prompt Utilities (SSRS).
Windows Management Use these classes to automate the configuration Visual
Instrumentation tasks in Report Server Configuration Manager Basic scrip
(WMI) Classes without the need to use the graphical user
interface.

For more information, see Accessing the WMI


Provider Programmatically.

LAB 10
Introduction to PL/SQL
PL/SQL is a block structured language that enables developers to combine the power of
SQL with procedural statements.All the statements of a block are passed to oracle engine
all at once which increases processing speed and decreases the traffic. 

Basics of PL/SQL

 •PL/SQL stands for Procedural Language extensions to the Structured Query Language
(SQL).
  PL/SQL is a combination of SQL along with the procedural features of programming
languages.
 Oracle uses a PL/SQL engine to processes the PL/SQL statements.
 PL/SQL includes procedural language elements like conditions and loops. It allows
declaration of constants and variables, procedures and functions, types and variable of
those types and triggers.
Disadvantages of SQL:
 SQL doesn’t provide the programmers with a technique of condition checking, looping
and branching.
 SQL statements are passed to Oracle engine one at a time which increases traffic and
decreases speed.
 SQL has no facility of error checking during manipulation of data.
Features of PL/SQL:
1. PL/SQL is basically a procedural language, which provides the functionality of decision
making, iteration and many more features of procedural programming languages.
2. PL/SQL can execute a number of queries in one block using single command.
3. One can create a PL/SQL unit such as procedures, functions, packages, triggers, and
types, which are stored in the database for reuse by applications.
4. PL/SQL provides a feature to handle the exception which occurs in PL/SQL block
known as exception handling block.
5. Applications written in PL/SQL are portable to computer hardware or operating system
where Oracle is operational.
6. PL/SQL Offers extensive error checking.

Differences between SQL and PL/SQL:


SQL PL/SQL

PL/SQL is a block of codes that used to write


SQL is a single query that is used to
the entire program blocks/ procedure/
perform DML and DDL operations.
function, etc.

It is declarative, that defines what needs to


PL/SQL is procedural that defines how the
be done, rather than how things need to be
things needs to be done.
done.

Execute as a single statement. Execute as a whole block.

Mainly used to manipulate data. Mainly used to create an application.

It is an extension of SQL, so it can contain


Cannot contain PL/SQL code in it.
SQL inside it.

Structure of PL/SQL Block:


PL/SQL extends SQL by adding constructs found in procedural languages, resulting in a
structural language that is more powerful than SQL. The basic unit in PL/SQL is a block.
All PL/SQL programs are made up of blocks, which can be nested within each

other.   
Typically, each block performs a logical action in the program. A block has the following
structure:
DECLARE
declaration statements;

BEGIN
executable statements

EXCEPTIONS
exception handling statements

END;

You might also like