Repository navigation
11. Database (Introduction, SQLPUS, Login, Objects, DQL (Select), Pipeline Operator)
Agnivo102 edited this page Jan 30, 2026
·
3 revisions
We can call Excel or Word or even paint a database as it can stores data. But they are unstructured database. Like in word we store data in documents. There to search for a specific data we would have to search all the paragraph. So they are not widely used for the purpose of storing data.
MS is management system which can manage the database. Management system in something through which we can manage the data, we can edit the data, we can update the data, we can delete the data within a fraction of a second. For that we need a language called SQL.
Any application that follows 12 rules of cordds can be called a rdbms. As excel or words is not following them we can't call them rdbms.
The things we do in a database like entering some values, retrieving some values, changing the data are called transaction.
A :- Atomicity:- Any transaction that begins must begin. In between if its interrupted is not a transaction.
C :- Consistency :- The volume of data before the transaction and after the transaction is the same.
D :- Durability :- When I saved data into the database it will remain the same unless someone changes it.
ps -ef | grep pmon
This file reside under etc directory. This file is not inbuilt. We we install oracle inside linux it will create automatically.
Now we see there are 3 databases dev, prod, orcl. Now lets try to open orcl. To open a database we need to use . oraenv.
In linux every thing is a process. A database running is also a process. Lets see which database is running.
Select * from tab; :- tab is a table which will store all the object or tables information of the user. ';' explain to the system that the query is completed.
The answer is in an unstructured format. Because the first column tname is taking so much space. For that
col tname for a20 :- col is the short form of column. tname is the name of the column. for a20 will only take 20 characters for the column tname.
set line 100 :- set that the screen will display 100 characters in a single line so that there are no overlap.
desc tablename :- Description of the table. Like the name of its fields (columns), their types, and whether the values of them can be null or not.
.........................................................................................................................................................
.........................................................................................................................................................
Display these 2 couluns but with these new names as the heading. When using any special character like (" ", "*" etc) as an alias put it inside double quote. Also without double quotes it will only display in capital letter format. Inside double quotes any format we give will display.
Select employee_id empno, first_name as "First Name", last_name "Last name", salary as "Montly Salary", (salary *10)/100 "PF" from employees;
Select employee_id empno, first_name || last_name "Full name", salary as "Montly Salary", (salary *10)/100 "PF", salary * 4 "Queterly Salary" from employees where salary > 10000;
Select employee_id as empno, first_name || last_name "Full Name", salary "Montly Salary" from employees;
Select employee_id empno, first_name || ' ' || last_name "Full name", salary as "Montly Salary", (salary *10)/100 "PF", salary * 4 "Queterly Salary" from employees where salary > 10000;