0% found this document useful (0 votes)
30 views11 pages

A.) Insert Into Q1 - Customer (Customerid, Customername, Contactno, Address, City, Postalcode, Country)

The document contains SQL queries and questions related to database tables. It includes queries to insert data into tables, select data from tables based on conditions, aggregate functions and joins. It also asks questions about drawing UML diagrams for common systems like banking, university, hotel, newspaper distribution, hospital and online shopping.

Uploaded by

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

A.) Insert Into Q1 - Customer (Customerid, Customername, Contactno, Address, City, Postalcode, Country)

The document contains SQL queries and questions related to database tables. It includes queries to insert data into tables, select data from tables based on conditions, aggregate functions and joins. It also asks questions about drawing UML diagrams for common systems like banking, university, hotel, newspaper distribution, hospital and online shopping.

Uploaded by

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

Q1)

a.) INSERT INTO q1_customer(CustomerID,CustomerName,ContactNo,Address,City,PostalCode,Country)

VALUES (1, 'Nisarg', 8460656212, 'abc','Ahmedabad','380058','India' );

INSERT INTO q1_customer (CustomerID,CustomerName,ContactNo,Address,City,PostalCode,Country)

VALUES (2, 'Adish', 9360656214, 'xyz','Baroda','380053','India');

INSERT INTO q1_customer (CustomerID,CustomerName,ContactNo,Address,City,PostalCode,Country)

VALUES (3, 'Devarsh', 8545674565, 'abc','Los Angeles','238438','America');

INSERT INTO q1_customer (CustomerID,CustomerName,ContactNo,Address,City,PostalCode,Country)

VALUES (4, 'Yash', 9884738495, 'abcd','Ahmedabad','380058','India' );

INSERT INTO q1_customer (CustomerID,CustomerName,ContactNo,Address,City,PostalCode,Country)

VALUES (5, 'Ajit', 8175930604, 'wxyz','Chicago','283458','America' );

b.) SELECT `CustomerID`, `CustomerName`, `ContactNo`, `Address`, `City`, `PostalCode`, `Country`


FROM `q1_customer` WHERE 1;

c.) SELECT * FROM `q1_customer` WHERE City='Ahmedabad';

d.) SELECT `CustomerName`, `ContactNo`FROM `q1_customer` WHERE Country='India';

e.) SELECT count( * ) as Total_records FROM q1_customer WHERE 1 ;

f.) SELECT * FROM q1_customer WHERE CustomerName RLIKE '^[A]';


Q 2)

Insert Queries:-

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (101, 'Nisarg', 'Patel', 1100000, 10);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (103, 'Vismay', 'Patel',1000000, 10);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (103, 'Jimil', 'Patel', 650000, 12);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (104, 'Raj', 'Mehta', 400000, 9);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (105, 'Yug', 'Shah', 900000, 11);


INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (106, 'Yash', 'Patel', 1500000, 14);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (107, 'Vatsal', 'Solanki', 300000, 11);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (108, 'Preet', 'Shah', 700000, 9);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (109, 'Dhyey', 'Patel', 750000, 10);

INSERT INTO employees (employee_number, first_name, last_name, salary, dept_id)

VALUES (110, 'Ugam', 'Thakkar', 800000, 14);

a.) SELECT * FROM `employees` WHERE 1;

b.) SELECT * FROM `employees` WHERE salary>1000000;

c.) SELECT * FROM `employees` WHERE salary>=500000 AND salary<=1000000 ;

d.) SELECT * FROM `employees` WHERE dept_id=10;

e.) SELECT `first_name`, `last_name` FROM `employees` WHERE dept_id!=10;

f.) SELECT count( * ) as Total_no_ofemployees FROM employees WHERE dept_id=10;

Q3.)
Insert Queries:-

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (101, 'Microsoft', Mousiee, 'Washington');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (102, 'Tata Consultancy Services', 'Gandhinagar', 'Gujarat');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (103, 'Accel Frontline', 'New Delhi', 'Delhi');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (104, 'Aditi Technologies', 'Bangalore', 'Karnataka');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (105, 'Cognizant', 'Bangalore', 'Karnataka');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (106, 'Cynapse', 'Mumbai', 'Maharastra');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)


VALUES (107, 'Godrej Infotech Ltd', 'Mumbai', 'Maharastra');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (108, 'Apple', 'Redmond', 'Washington');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (109, 'Somani technologies', 'Ahmedabad', 'Gujarat');

INSERT INTO suppliers (supplier_id, supplier_name, city, state)

VALUES (110, 'Gooogle', 'Redmond', 'Washington');

a.) SELECT * FROM `suppliers` WHERE city='Redmond';


b.) SELECT * FROM `suppliers` WHERE city='New York' OR city='Redmond';
c.) SELECT * FROM suppliers ORDER BY supplier_name ASC;
d.) SELECT DISTINCT `city` FROM `suppliers` WHERE `state` LIKE "washington" ORDER BY `city` DESC;

Q4.)

SELECT OrderID,CustomerName,OrderDate FROM customertable a,ordertable b

WHERE a.CustomerID=b.CustomerID;

UML Diagrams
Q5.) Banking System

Q6.) University Management System


Q7.) Hotel management system
Q8.) Newspaper Distributor System
Q9.) Hospital Management System
Q10.) Online Shopping System

You might also like