Experiment 1 BASICS OF DATABASE MANAGEMENT
30.12.2024
AIM :
To understand the basic concepts of database management
1. What is RDBMS? Explain with examples.
RDBMS (Relational Database Management System) is a type of database management system
(DBMS) that stores data in the form of tables (relations). These tables are linked using keys, and the
data is organized in rows and columns, making it easy to manage and retrieve data. RDBMS uses
Structured Query Language (SQL) to query and manipulate data.
Examples of RDBMS:
Oracle Database: A powerful and widely-used RDBMS, known for its robustness and
scalability.
MySQL: A popular open-source RDBMS commonly used in web applications.
Microsoft SQL Server: A relational database management system developed by Microsoft.
PostgreSQL: An open-source RDBMS that emphasizes extensibility and SQL compliance.
2. Identify and write the data types that are supported by Oracle.
Oracle supports various data types categorized as follows:
Numeric Data Types:
o NUMBER: For storing numbers, both integer and floating-point values.
o INTEGER: A subtype of NUMBER, typically used for whole numbers.
o FLOAT: A subtype of NUMBER, used for floating-point numbers.
Character Data Types:
o CHAR: Fixed-length character data.
o VARCHAR2: Variable-length character data (commonly used for text).
o CLOB: Character Large Object (used for large text data).
Date and Time Data Types:
o DATE: Stores date and time (including day, month, year, hours, minutes, and
seconds).
o TIMESTAMP: More precise date and time data (including fractions of a second).
o INTERVAL: Used to store differences in time (e.g., days, months, years).
Binary Data Types:
o BLOB: Binary Large Object (used for storing large binary data, like images or files).
o RAW: Stores variable-length binary data.
Boolean and Miscellaneous:
o BOOLEAN: Oracle does not have a native BOOLEAN type; it uses NUMBER(1) or
CHAR(1) instead.
o XMLTYPE: Stores XML data.
3. What is meant by ACID properties in DBMS?
ACID stands for Atomicity, Consistency, Isolation, and Durability, and these properties ensure that
database transactions are processed reliably.
Atomicity: A transaction is treated as a single unit, meaning either all operations within the
transaction are completed, or none are. It guarantees no partial updates to the database.
Consistency: A transaction takes the database from one consistent state to another. It
ensures that the database always follows the defined rules and constraints, such as primary
keys, foreign keys, etc.
Isolation: Each transaction is isolated from others. Even if multiple transactions occur
simultaneously, the operations of one transaction will not be visible to others until they are
complete.
Durability: Once a transaction is committed, the changes are permanent, even in the event
of a system crash.
4. Are NULL values in a database the same as that of blank space or zero?
No, NULL values in a database are not the same as blank spaces or zero.
NULL represents the absence of a value or an unknown value. It means that the data is
missing or undefined.
A blank space (empty string) is a value that explicitly contains no characters but is still a
value.
Zero (0) is a numerical value and signifies "nothing" or "none" in a quantitative sense.
For example:
NULL could mean that the age of a person is unknown.
A blank space might mean that the person’s address is provided, but there’s no street name.
Zero could mean the person has no children.
5. What is a data model?
A data model is a conceptual framework that describes the structure, relationships, constraints, and
operations on the data in a database. It defines how data is stored, organized, and manipulated.
Entity-Relationship Model (ER Model): Represents entities and their relationships.
Relational Model: Organizes data into tables (relations).
Hierarchical Model: Represents data in a tree-like structure.
Network Model: Represents data in a graph structure where entities are nodes and
relationships are edges.
6. Define Instances and Schema?
Schema: A schema is the logical blueprint or structure of a database. It defines how data is
organized, including the tables, views, indexes, and relationships between them. The schema
does not contain data itself but represents the organization of data. It is defined at the time
of database creation and does not change frequently.
Example: The schema of a university database might include tables like Students, Courses,
Departments, with relationships between them.
Instance: An instance refers to the data in the database at a particular point in time. It is a
snapshot of the database with actual data values. It changes as data is added, deleted, or
modified.
7. What is SQL?
SQL (Structured Query Language) is a standard programming language used to manage and
manipulate relational databases. It is used for tasks such as querying, updating, inserting, and
deleting data, as well as managing database structures.
Some common SQL operations include:
SELECT: Retrieve data from a table.
INSERT: Insert new data into a table.
UPDATE: Modify existing data in a table.
DELETE: Remove data from a table.
8. What are SQL dialects? Give some examples.
SQL dialects refer to variations in SQL syntax and functionality that are specific to different database
management systems (DBMS). While SQL is standardized, each DBMS may implement additional
proprietary extensions or modify the standard in certain ways.
Examples of SQL Dialects:
MySQL SQL Dialect: May support different functions or slightly different syntax compared to
other databases.
Microsoft SQL Server SQL (T-SQL): Includes proprietary features like TOP, IDENTITY, and
other extensions.
Oracle SQL (PL/SQL): Oracle’s dialect, with extensions like PL/SQL (Procedural Language for
SQL).
PostgreSQL SQL: Known for supporting advanced SQL features like window functions,
recursive queries, etc.
SQLite SQL: A lighter, file-based RDBMS with some unique SQL dialect features.
9. What are the main applications of SQL?
SQL is used in many applications, including:
Data Retrieval: Extracting specific data from databases (e.g., SELECT queries).
Database Management: Creating, modifying, and managing database structures (e.g.,
CREATE, ALTER, DROP).
Data Insertion/Deletion: Adding or removing records from tables (e.g., INSERT, DELETE).
Data Update: Modifying existing records in a table (e.g., UPDATE).
Database Security: Controlling access and permissions to ensure secure data handling.
Data Analysis and Reporting: Using SQL queries for analysis (e.g., aggregate functions like
COUNT, SUM, AVG).
Database Optimization: Indexing and querying optimizations for performance.
10. What are the different types of SQL commands? List down the commands in each category.
SQL commands can be categorized into the following types:
1. DDL (Data Definition Language): Used for defining and managing database structures.
o CREATE: Creates new tables, views, etc.
o ALTER: Modifies an existing database structure.
o DROP: Deletes database objects like tables, views.
o TRUNCATE: Removes all records from a table but retains the structure.
2. DML (Data Manipulation Language): Used for managing data within schema objects.
o SELECT: Retrieves data from one or more tables.
o INSERT: Adds new records to a table.
o UPDATE: Modifies existing records.
o DELETE: Removes records from a table.
3. DCL (Data Control Language): Used for defining user access and permissions.
o GRANT: Provides privileges to users.
o REVOKE: Removes privileges from users.
4. TCL (Transaction Control Language): Used to manage the transactions in a database.
o COMMIT: Saves all changes made during the transaction.
o ROLLBACK: Undoes changes made during the transaction.
o SAVEPOINT: Sets a point in a transaction to which you can roll back.
PRACTICE :
1. Create a relation(table) for storing the product details in a supermarket
2. Insert minimum of six product details in the created table.
3. List all the products to the user
4. Truncate the table.
5. Drop the table.
6. Use commit and savepoints
OUTPUT :
RESULT : THE BASICS OF MYSQL AND SAMPLE PRACTICE PROGRAMS HAVE BEEN STUDIED AND
IMPLEMENTED