0% found this document useful (0 votes)
9 views6 pages

DBMS Lab 1

The document outlines a database management lab assignment involving the creation of a 'Client_master' table with specified attributes and data types. It includes sample data for clients and a series of SQL queries to retrieve various information from the table. The queries cover client names, locations, and specific client details based on given conditions.

Uploaded by

vibhavbhartiya13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views6 pages

DBMS Lab 1

The document outlines a database management lab assignment involving the creation of a 'Client_master' table with specified attributes and data types. It includes sample data for clients and a series of SQL queries to retrieve various information from the table. The queries cover client names, locations, and specific client details based on given conditions.

Uploaded by

vibhavbhartiya13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

DBMS LAB 1

Name-Vibhav
Roll No-2200290100189
Create these two tables with following specifications and insert data in the
table:
Table Name: Client master
Attribute Data Type Size
Client_no Number 6
Client_Name Varchar2 20
City Varchar2 15
State Varchar2 15
Pin Number 6
Balance_due Number 10,2

Data for Client master:


CLIENT_NO Client_NAME CITY PIN_CODE STATE BAL_DUE

0001 Ivan Bombay 400057 Maharastra 15000

0002 Vandura Madras 980001 Tamilnadu 0

0003 Pramod Bombay 400057 Maharastra 5000

0004 Basu Bombay 400056 Maharastra 0

0005 Ravi Delhi 100001 Null 2000

0006 Rukmini Bombay 900050 Maharastra 0

CREATE TABLE Client_master (


Client_no NUMBER(10),
Client_Name VARCHAR2(20),
City VARCHAR2(15),
State VARCHAR2(15),
Pin NUMBER(6),
Balance_due FLOAT(10)
);

INSERT INTO Client_master VALUES (0001, 'Ivan', 'Bombay', 'Maharastra',


400057, 15000);
INSERT INTO Client_master VALUES (0002, 'Vandura', 'Madras', 'Tamilnadu',
980001, 0);
INSERT INTO Client_master VALUES (0003, 'Pramod', 'Bombay', 'Maharastra',
400057, 5000);
INSERT INTO Client_master VALUES (0004, 'Basu', 'Bombay', 'Maharastra',
400056, 0);
INSERT INTO Client_master VALUES (0005, 'Ravi', 'Delhi', 'null', 100001, 2000);
INSERT INTO Client_master VALUES (0006, 'Rukmini', 'Bombay', 'Maharastra',
900050, 15000);

SELECT * FROM Client_master;

Now, perform following queries on the above data:


(a) Find out the name of all the clients.
(b) Retrieve the list of names and cities of all the clients.
(c) List all the clients who are located in Bombay.
(d) Display the information for client no 0001 and 0002.
(e) Find the list of all clients who stay in city ‘Bombay’ or ‘Delhi’ or ‘Madras’.
(f) List the name, city, and state of clients not in state of ‘Maharashtra’

SELECT Client_Name FROM Client_master;

SELECT * FROM Client_master WHERE City='Bombay';


SELECT Client_Name,City FROM Client_master;

SELECT * FROM Client_master WHERE Client_no=0001 or Client_no=0002;


SELECT * FROM Client_master WHERE City IN('Bombay','Delhi','Madras');

SELECT Client_Name, City,State FROM Client_master WHERE State !=


'Maharastra';

You might also like