Refer To Q. No 4 From March 2015
Refer To Q. No 4 From March 2015
RDBMS
1. what is DBMS?
Examples: Microsoft Access, MySQL, Microsoft SQL Server, Oracle and FileMaker Pro are all
examples of database management systems.
2. What is normalization
Table:
Views:
We can assign the view, a name & relate it the query expression as
Create View <View Name> as <Query Expression>
4. What is DBA
Oracle Database is the first database designed for enterprise grid computing, the most flexible
and cost effective way to manage information and applications.
In an SQL database, a foreign key is a column, or set of columns, which creates a link between
its table and another table. The main table that the link is created from contains a primary key,
which links to the foreign key of the second table. This primary key > foreign key link allows
one or more rows of data in one table to link, or relate, to one or more rows of data in another
table.
A foreign key is created by using the "FOREIGN KEY" constraint when either creating a new
database table or altering an existing database table. The column designated as a foreign key
also inherently has the "NOT NULL" constraint, which means it must contain a value and
cannot be blank.
8. What is BCNF?
Boyce and Codd Normal Form is a higher version of the Third Normal form. This form deals
with certain type of anamoly that is not handled by 3NF. A 3NF table which does not have
multiple overlapping candidate keys is said to be in BCNF. For a table to be in BCNF, following
conditions must be satisfied:
PART B
OR
(b) write the risks and costs associated with the database
In database approach in order to maintain or develop database we should take a risk and we
should invest money , time and environment. Database approach when we develop a new
database or when we maintain an existing database we should consider the following points.
Need for Explicit Backup and Recovery: A shared database must be accurate and available
at all times. This raises the need to have backup copies of data for restoring a database when
damage occurs. A modern database management system normally automates recovery tasks.
OR
Relational algebra is a procedural query language, which takes instances of relations as input
and yields instances of relations as output. It uses operators to perform queries. An operator
can be either unary or binary. They accept relations as their input and yield relations as their
output. Relational algebra is performed recursively on a relation and intermediate results are
also considered relations.
Notation − σp(r)
For example −
σsubject = "database"(Books)
Output − Selects tuples from books where subject is 'database' and 'price' is 450.
Output − Selects tuples from books where subject is 'database' and 'price' is 450 or those
books published after 2010.
For example −
r ∪ s = { t | t ∈ r or t ∈ s}
Notion − r U s
Output − Projects the names of the authors who have either written a book or an article or
both.
Notation − r − s
Finds all the tuples that are present in r but not in s.
Output − Provides the name of authors who have written books but not articles.
Notation − r Χ s
r Χ s = { q t | q ∈ r and t ∈ s}
Notation − ρ x (E)
Set intersection
Assignment
Natural join
11 (a). Write about SQL. Explain any two DDL and DML commands
SQL (Structured Query Language) is a standardized programming language used for managing
relational databases and performing various operations on the data in them.
The uses of SQL include modifying database table and index structures; adding, updating and
deleting rows of data; and retrieving subsets of information from within a database for
transaction processing and analytics applications. Queries and other SQL operations take the
form of commands written as statements -- commonly used SQL statements include select,
add, insert, update, delete, create, alter and truncate.
DDL Commands
Data definition language defines the schema for the database by specifying entities and the
relationship among them. In addition to this, DDL even defines certain security constraints.
create command
create is a DDL command used to create a table or a database.
Creating a Database
To create a database in RDBMS, create command is uses.
Syntax : create database database-name;
Example for Creating Database
create database Test;
The above command will create a database named Test.
Creating a Table
create command is also used to create a table. We can specify names and datatypes of various
columns along.Following is the Syntax,
create table table-name
{
column-name1 datatype1,
column-name2 datatype2,
column-name3 datatype3,
column-name4 datatype4
};
create table command will tell the database system to create a new table with given table
name and column information.
Example for creating Table
create table Student(id int, name varchar, age int);
The above command will create a new table Student in database system with 3 columns,
namely id, name and age.
alter command
alter command is used for alteration of table structures. There are various uses
of alter command, such as,
DML Command
Data Manipulation Language (DML) statements are used for managing data in database. DML
commands are not auto-committed. It means changes made by DML command are not
permanent to database, it can be rolled back.
1) INSERT command
Insert command is used to insert data into a table.
Syntax : INSERT into table-name values(data1,data2,..)
Example
Consider a table Student with following fields.
101 Adam 15
2) UPDATE command
Update command is used to update a row of a table.
Syntax :UPDATE table-name set column-name = value where condition;
Example:
update Student set age=18 where s_id=102;
101 Adam 15
102 Alex 18
103 chris 14
OR
(b) Explain about database change operations like arithmetic operators and logical
operators.
Operator Meaning
+ (Add) Addition
- (Subtract) Subtraction
* (Multiply) Multiplication
/ (Divide) Division
% (Modulo) Returns the integer remainder of a division. For example, 17 % 5 = 2
because the remainder of 17 divided by 5 is 3.
Syntax :
SELECT <Expression>[arithmetic operator]<expression>...
FROM [table_name]
WHERE [expression];
Parameter Description
Operator Description
AND Logical AND compares between two Booleans as expression and return
true when both expressions are true...
NOT Not takes a single Boolean as an argument and changes its value from false
to true or from true to false....
BETWEEN The SQL BETWEEN operator tests an expression against a range. The range
consists of a beginning, followed by an AND keyword and an end
expression....
ANY ANY compares a value to each value in a list or results from a query and
evaluates to true if the result of an inner query contains at least one row....
SOME SOME compares a value to each value in a list or results from a query and
evaluates to true if the result of an inner query contains at least one row...
EXISTS The EXISTS checks the existence of a result of a subquery. The EXISTS
subquery tests whether a subquery fetches at least one row. When no data
is returned then this operator returns 'FALSE'...
Syntax
SELECT [column_name | * | expression] [logical operator]
FROM <table_name>
Parameters
Name Description
OR
OR