Lab 1 To 10 - D2D-09 - Removed
Lab 1 To 10 - D2D-09 - Removed
Practical 1
Aim: Introduction to RDBMS and APEX Login.
APEX login:
Step 1:https://apex.oracle.com/pls/apex/
Step 3:Fill all the required details carefully like: First Name: Your name(ex. Mitesh)
Step 6:Click on checkbox to agree terms and conditions and Click on next.
Step 8: After that you will receive an email on your institute email id.
Step 11: Set your new password and confirm password and click on change password.
Practical 2
Write a program to implement all DDL queries
Create a table ACCOUNT
acc_no varchar2 5
Name varchar2 30
City varchar2 20
Loan_taken varchar2 5
Solution :
Solution :
loan_no varchar2 5
acc_no varchar2 5
loan_date date
Solution :
Solution :
Output
loan_no varchar2 5
inst_no varchar2 5
inst_Date Date
Solution :
Solution :
acc_no Varchar2 5
tr_Date Date
type_of_tr Char 1
mode_of_pay Varchar2 10
Solution :
Solution :
List of queries
Output
1.
2.
3.
4.
5.
Practical 3
Write a program to implement all DML queries
Table: ACCOUNT.
2. Change the name and city where account number is A005. (new name = ‘kothari nehal’ and
new city = ‘patan’).
4. Add the new column (address varchar2 (20)) into table ACCOUNT.
5. Create another table ACCOUNT_TEMP (acc_no, name, balance) from table ACCOUNT.
7. update the column balance for all the account holders. (Multiply the balance by 2 for each
account holders
Table: LOAN.
1. For each loan holders Add 100000 Rs. Amount into the column loan_amt.
3. Create another table LOAN_TEMP (loan_no, Acc_no, loan_amt, loan_date) from The
table LOAN.
4. Display only those records where loan holder taken a loan in month of January.
5. Modify the structure of table LOAN by adding one column credit_no varchar2
8. Display the records of table LOAN by account number wise in descending Order.
Table: INSTALLMENT.
Table: TRANSACTION.
2. Insert any duplicate value and display all the records without any duplicate
rows.
Practical 4
Write a program to implement all DCL queries.
Practical 5
Practical 7
Write a program to implement all inbuilt functions of SQL
SELECT
UPPER(name) AS uppercase_name,
LOWER(name) AS lowercase_name,
INITCAP(name) AS initcap_name,
LENGTH(name) AS name_length,
SUBSTR(name, 1, 4) AS substring_name,
CONCAT(name, ' - Employee') AS concat_name
FROM sample_data;
SELECT
salary,
ROUND(salary, 0) AS rounded_salary,
TRUNC(salary, 0) AS truncated_salary,
MOD(salary, 1000) AS mod_salary,
ABS(salary - 5000) AS absolute_diff
FROM sample_data;
Practical 8
Write a program to implement Triggers in SQL.
Create trigger which executed before insert on student table and check value for
email Id whether it is already exist or not if exist then prevent insertion and
display error message.
Practical 9
Write a program to implement Procedures in SQL.
Create procedure which accept two parameter account number and withdraw
amount from account table. Display available balance before and after
withdraw.
-- Test the procedure by attempting to withdraw 8000 from account 'A003' (should
fail due to insufficient balance)
BEGIN
withdraw_amount('A003', 8000);
END;
Practical 10
Write a program to implement View in SQL.
1)create view on employee table which includes all records of only “marketing”
department.
-- Select employee name, salary, and bonus from the employee_salary_bonus view
SELECT * FROM employee_salary_bonus;