You are on page 1of 10

Micro-Project Proposal

Execute queries using SELECT command with DDL command:

1.0 Rationale

Database Management Systems (DBMS) are vital components of modern information


systems. Database applications are pervasive and range in size from small in-memory
databases to terra bytes or even larger in various applications domains. The course focuses on
the fundamentals of knowledgebase and relational database management systems, and the
current developments in database theory and their practice.

2.0 Aim of Micro-Project Creating

a database with two tables holding specific data in its tuples. Executing queries with the use
of SELECT command with DDL command to get a desired output through certain conditions.

Method: Using Transformations.

3.0 Course Outcomes Addressed

a) Create and Manage Database using SQL.

b) Design Normalized database on given data.

c) Create and manage Data base using SQL command.

d) Write a SQL command for given data base.

e) Apply security and confidentiality on given database.

4.0 Literature Review

In the existing literature the emergency system were a blood receiver can get help from the
blood bank management system are described in the blood bank system have many problems
such as shortage of required blood, time duration to keep the blood safe, of required blood,
time duration to keep the blood safe.

A) SELECT COMMAND –

B) DDL Command–
A) SELECT COMMAND –

A SELECT/COMMAND statement retrieves zero or more rows from one or more database
tables or database views. In most applications, SELECT is the most commonly used data
query language (DQL) command. As SQL is a declarative programming language, SELECT
queries specify a result set, but do not specify how to calculate it. The database translates the
query into a "query plan" which may vary between executions, database versions and
database software. This functionality is called the "query optimizer" as it is responsible for
finding the best possible execution plan for the query, within applicable constraints.

Syntax –

Select * from table_name;

Example:

Select* From Doctor;


B) DDL Command –

DDL stand for Data Definition Language which is used to define or design the structure of
Database or table.

This type includes following commands as shown in fig.

DDL COMMNAS

Create Alter Drop Desc

Truncate Rename Create User


1) Create command –

This command is used to create the table or defend structure of table. While creating a
table the name of table and its fields (column names) with its data type and size. The
command is terminated by ‘ ; ‘ Remember the following rule for creating table.

A) A name of table can be maximum up to 30 characters.


B) Alphabets (A-Z or a-z) are used along with number (0-9).
C) The table name should be started with alphabet inly.
D) Repetition of table name in same database is not allowed.

Syntax –

Create table <table_name> ( <column_name 1> <datatype> (size),<column_name 2>


<datatype>(size) <column_name n><datatype> (size) );

Example:

Create table Doctor (doc_id int primary key,doc_name varchar2(20) , doc_add


varchar2(20),doc phno int);

2) Alter command –

This command is used to make certain changes in structure of table after creating it. It helps
in modifying the table if we want to change data type or size of size of table, add new column
delete any column, etc.

Syntax –

Alter table <table_name> <action to be taken>;

Example:

Alter table emp delete(dept_no);

3) Truncate command –

Truncate command is useful when you just want to delete the row only. After using this
command just data is delete the structure of table remain same i.e the table exist in database.

After truncate command, you can reenter the row in the table.

Syntax –

Truncate table <table_name>;

Example:
Truncate table doctor;

4) Drop command –

Drop with the help of this command the whole table can be delete. After using this command
the whole structure of database / table along with the data is deleted permanently.

So after this the table will not be present at any cost i.e the table not exist.

Syntax –

Drop table <table_name>

Example:

Drop table doctor;

5)DESC –

The table structure can be seen with the help of DESC command. To check structure of table.

Syntax –

desc <table_name>;

Example:

Desc doctor;

4) Rename –

This command is used to rename a table from database i.e we can give a new name to table.
This command is preferable for changing name of table because the alter table command has
no power to d this. It can rename only column.

Systax –

Rename <table_name>to <new table_name>;

Example:

Rename doctor to DOC;

5) Creating user –

Create user command is used to create the user. We need to specify user name and identify by
clause.

Syntax –

Create user <usre_account> indentified by<password>;


Example:

Create user 1 identified externally;

5.0 Actual Procedure Followed –

Designed plans through which we can get ideology of executing queries.

2. Created two tables using DML commands.

3. Inserted values into those two tables.

4. Displayed the tables with their records with SELECT command.

5. Executed queries by using DDL command with the help of SELECT command to tackle
and get output according to the conditions.

6. Tested the queries 4-5 times before the final confirmation.

7. Attached the output of project at the end. 8. Finalized report

6.0 Resources Required

Sr. Name of Resource/material Specification Oty remarks


No
1 Computer 4.00 GB RAM with 1
32 bit OS windows
7
2 Software Oracle 11g SQL 1

3 printer HP Deskjet P2 6200 1

7.0 Skill Developed / learning out of this Micro-Project

The project can be used in many aspects where there is a need of the database to store the
records of specific things be it a school, university or office. It can also be used in storing
data of any sport player, game’s statistics and many other things. Secondly the queries can be
used to learn DBMS more clearly and its various features.

8.0 Outputs of the Micro-Projects –

 QUERY :-

Table name - Doctor

 Create table :-

Create table Doctor (doc_id int primary key,doc_name varchar2(20) , doc_add


varchar2(20),doc_
Phno int);

Insert values to table :-

insert into Doctor values(101,'sanvi',gadhinglag,9405106233);

insert into Doctor values(102,'soham',pune,7735843928);

insert into Doctor values(103,'nikhil',pune,9405297354);

insert into Doctor values(104,'sanika',Mumbai’,9420455655);

 Alter table :-

Table name - Donor

alter table donor add dob_dob int;


 DESC table:-

Table name - blood

Desc blood ;

 Rename table:-

Table name - patient

Rename table patient to forbearing;


 Truncate table:-

Table name – blood bank

Truncate table blood bank;

 Drop table :-

Drop table patient;


 CONCLUSION
BBMS is a management system that is developed to manage blood bank .The BBMS had
been developed to user requirement. This is to make sure that the management of the blood
stock became effective, systematic and meeting user requirements. The functional services
provided in the current version are profile management, blood stock management, and blood
analysis management. In the next phase we will develop a portable and modified BBMS
version based on android OS. The modified version will include a user self-monitoring health
profile history.

 REFERENCE

http://gis.jharkhand.gov.in>bbms

http://www.sciencedirect.com>co

http://www.studocu.com>doc

http://www.justdial.com

You might also like