DBMS File
DBMS File
Objective:
a. Introduction to DBMS, RDBMS, DBMS Vs RDBMS
b. Introduction to SQL ,Types of SQL Statements (DDL, DML, TCL,DCL)
c. Introduction to various RDBMS software
d. Oracle Installation, Oracle Live
a) Introduction to DBMS, RDBMS, DBMS Vs RDBMS
Database Management System (DBMS): is a software for storing and
retrieving user’s data while considering appropriate security measures.
Ex: Oracle, MS SQL, MongoDB, MySQL etc.
Relational Database Management System (RDBMS): A database
management system that manages data as a collection of tables in which
all relationships are represented by common values in related tables.
DBMS Vs RDBMS:
b) Introduction to SQL , Types of SQL Statements (DDL, DML,
TCL,DCL)
SQL (Structured Query Language): It is used to perform
operations on the records stored in the database such as updating records,
deleting records, creating, and modifying tables, views, etc.
Types of SQL Statements:
c) Introduction to various RDBMS software
d) Oracle Installation:
Step 1: Go to the Oracle website at http://www.oracle.com.
Step 2: Click on Downloads, and then under Database, click on Oracle Database 11g
Express Edition.
Step 3: Accept the license agreement and select the download version you are
interested in for example, you can download the Oracle Database 11g Release 2
Express Edition for Windows 64 database. The OracleXE112_Win64.zip file is
downloaded.
Step 4: Unzip the .zip file by right-clicking on the file and selecting Extract All..., then
click Extract on the next window. You will now see a DISK1 folder, and inside it is
the setup.exe executable file.
Step 5: Double-click on setup.exe to start the Oracle database installation.
Step 6: On the Welcome to Install Wizard window, click Next.
Step 7: Accept the terms in the license agreement, and click Next.
Step 8: Enter a password, and click Next. This is the password to the SYSTEM
account and you can use any password you wish just note it down.
Step 9: Continue the next windows, click Install to install the database, and
click Finish once installation is complete.
After installation How to use Oracle11g:
• CREATE: This DDL command is used to create any database with its different objects
such as tables, indexes, triggers, views, stored procedures, built-in functions etc.
• ALTER Statement: Oracle ALTER statement is used when you want to change the
name of your table or any table field. It is also used to add or delete an existing
column in a table. The ALTER statement is always used with "ADD", "DROP" and
"MODIFY" commands according to the situation.
• DROP Table: is used to remove data from the table with schema.
PROGRAM NO. 4
• Order by clause
PROGRAM NO.7
SQL QUERY :
SELECT ROLLNO, FIRST_NAME || ' ' || LAST_NAME NAME,
DATE_OF_BIRTH, TRUNC(MONTHS_BETWEEN(SYSDATE,
DATE_OF_BIRTH) / 12) || ' YRS' AGE FROM STUDENTS
PROGRAM NO.8
SQL QUERY:
SELECT department_id, AVG(salary) AS avg_salary, COUNT(*) AS
total_employees
FROM employees
GROUP BY department_id;
2. Single-Row Functions
Single-row functions operate on each row independently and return one result
per row. They can modify data, format strings, and perform calculations.
SQL QUERY:
SELECT UPPER(employee_name) AS name_uppercase, ROUND
(salary, 2) AS rounded_salary, MONTH(hire_date) AS hiring_month
FROM employees;
PROGRAM NO. 9