Database lab task 1 (24011556_054)
Database lab task 1 (24011556_054)
SUBMMITED BY:
HIRA BINT-E- RAZZAQ
ROLL NO:
2011556-054
SUBBMITED TO:
MAM HIRA TARIQ
COURSE CODE:
IT-244.
DEPARTMENT OF
INFORMATION TECHNOLOGY
Question 1:
What is Oracle Database?
Oracle Database is a multi-model database management system (DBMS) developed and
marketed by Oracle Corporation. It is one of the most widely used relational database systems in
the world. Oracle Database is designed to store, organize, and retrieve data efficiently,
supporting a variety of data types, including structured, semi-structured, and unstructured data.
Key features of Oracle Database include:
Relational Database Management System (RDBMS): It organizes data into tables with
rows and columns, allowing for efficient data retrieval and manipulation using SQL
(Structured Query Language).
Scalability: Oracle Database can handle large volumes of data and supports high-
performance applications, making it suitable for enterprises of all sizes.
High Availability: Features like Real Application Clusters (RAC), Data Guard, and
backup/recovery options ensure minimal downtime and data loss.
Security: Oracle provides robust security features, including encryption, access controls,
and auditing, to protect sensitive data.
Question 2:
What are pros and cons of oracle database?
Pros and Cons of Oracle Database
Pros:
1. Performance & Scalability
o Oracle is optimized for high performance with features like Real Application
Clusters (RAC) and in-memory processing.
o Scales well for large enterprise applications and supports distributed databases.
2. Security
o Advanced security features such as Transparent Data Encryption (TDE), Virtual
Private Database (VPD), and Data Masking.
o Ensures compliance with industry security standards.
3. High Availability & Reliability
o Features like Data Guard, Flashback Technology, and Automatic Storage
Management (ASM) provide continuous availability and disaster recovery.
4. Multi-Platform Support
o Runs on multiple operating systems, including Windows, Linux, and UNIX.
o Supports hybrid cloud environments (on-premises & cloud deployment).
5. Strong Support & Documentation
o Extensive community and enterprise support from Oracle.
o Regular updates and improvements.
Cons:
1. High Cost
o Licensing and maintenance costs are expensive, making it less ideal for small
businesses.
o Additional costs for advanced features (e.g., RAC, Partitioning).
2. Complexity
o Requires highly skilled DBAs for setup, tuning, and management.
o Steep learning curve for new users.
3. Resource-Intensive
o Demands high CPU and memory resources, leading to higher hardware costs.
o Can be overkill for small applications.
4. Vendor Lock-in
o Switching to another database can be challenging due to proprietary technologies
and PL/SQL dependency.
5. Frequent Patches & Updates
o Regular updates require careful planning and testing to avoid downtime or
compatibility issues.
Question 3:
What are different types of SQL Statements? Explain with examples
Types of SQL Statements with Examples
SQL statements are categorized into five main types:
1. Data Query Language (DQL)
Used to retrieve data from a database.
Example (SELECT Statement):
SELECT * FROM employees;
Retrieves all columns from the employees table.
Can include filtering using WHERE, sorting using ORDER BY, etc.
2. Data Definition Language (DDL)
Used to define and manage database structures. These commands are autocommitted (changes
cannot be rolled back).
Example (CREATE Statement - Creates a Table):
CREATE TABLE employees (
emp_id INT PRIMARY KEY,
name VARCHAR (100),
salary DECIMAL (10,2),
department VARCHAR (50)
);
Example (ALTER Statement - Modifies a Table):
ALTER TABLE employees ADD COLUMN age INT;
o Adds a new column age to the employees table.
Example (DROP Statement - Deletes a Table):
DROP TABLE employees;
o Deletes the employees table permanently.
QUESTION 4:
Perform following Sql queries.
Display all the data from EMPLOYEE table whose Department number is 30.
Display all the data from DEPARTMENT table whose Department number is 10.
Retrieve and display Job, Hire Date and Salary columns from EMPLOYEE table.