Experiment No.1: Dbms Lab (RCS-551)
Experiment No.1: Dbms Lab (RCS-551)
(RCS-551)
EXPERIMENT NO.1
AIM
A database is an organized collection of data, stored and accessed electronically. Database designers
typically organize the data to model aspects of reality in a way that supports processes
requiring information. In relational databases, and flat file databases, a table is a set of data
elements using a model of vertical columns and horizontal rows, the cells being the unit
where a row and column intersect. A table has a specified number of columns, but can have
any number of rows. The row is called a tuple and the columns are known as attributes.
The number of tuples in a table is called as its domain. Each tale has its own schema which is created by
when the create table command is executed with given set of attributes, with the help of insert
command we record the data into the tables which is termed to be as tuple. In each table we
have different keys which helps to uniquely identify the tuple or differentiate between
different records. In DBMS the processing speed of the tables when required is very fast even
on big data.
SYNTAX/COMMANDS USED
3. show databases;
4. show tables;
5. desc <table_name>;
LAB ASSIGNMENT
Query: Create two tables named client_master and product_master with the following
fields mentioned below respectively.
#client_master client_no varchar(6)
city varchar(15)
state varchar(15)
pincode numeric(6)
bal_due numeric(10,2)
numeric(6));
EXPERIMENT NO.2
AIM
The SQL SELECT Statement : The SELECT statement is used to select data from a database.The
data returned is stored in a result table, called the result-set.
The SQL WHERE Clause : The WHERE clause is used to filter records.The WHERE clause is used to
extract only those records that fulfill a specified condition
The SQL AND, OR and NOT Operators: The WHERE clause can be combined with AND, OR, and NOT
operators.
The AND and OR operators are used to filter records based on more than one condition:
● The AND operator displays a record if all the conditions separated by AND is TRUE. ● The OR
operator displays a record if any of the conditions separated by OR is TRUE.
SYNTAX/COMMANDS USED
LAB ASSIGNMENT
Query : Retrieve the list of names and cities of all the cities. Solution
VISHAL SHUKLA IT-2(B2) 1709113122
DBMS Lab
(RCS-551)
Query : Find the product with description as “1.44Drive” and “1.22Drive” Solution
Query : Find list of all clients who stay in city “Bombay” or “Delhi” or “Madras”. Solution
Query : Find the product whose Selling Price >2000 or <=5000. Solution
VISHAL SHUKLA IT-2(B2) 1709113122
DBMS Lab
(RCS-551)
Query : List name, city, state of clients who do not belong to “Maharashtra”. Solution
Query : Find the product whose Selling Price >1500 and also update new Selling Price as Original
Selling Price*15.
Solution
Query : Find out clients who stay in city whose second letter is “a”. Solution
VISHAL SHUKLA IT-2(B2) 1709113122
DBMS Lab
(RCS-551)
Query : Find out names of all clients having ‘a’ as second letter in their name. Solution
Query : List product_no and description whose profit % is in between 20 and 30 both inclusive.
Solution
VISHAL SHUKLA IT-2(B2) 1709113122