GE Practical CS
GE Practical CS
Create a Database having following tables with the specified fields, to computerize a library
system of a Delhi university college:
1. Identify Primary and Foreign Keys. Create the tables and insert following records in each
table.
Create a Database having following tables to store the details of students of computer
science department in your college:
1. Identify Primary and Foreign Keys. Create the tables and insert following records in each
table.
College Student Date Of Address Marks Phone No
Roll No Name Birth In 12th
15101 Kiara 15/01/2000 Delhi 90 9891309874
15102 Lucy 22/05/1999 Jaipur 85 9911729278
15103 Edward 09/12/2000 Kerala 92 9562091819
15104 John 03/10/1998 Delhi 96 8560272305
15105 Alice 24/09/1999 Bangalore 87 9871642090
Paper_Code Paper_Name
101 Paper1
102 Paper2
103 Paper3
104 Paper4
105 Paper5
2. Design a query that will return the records (from the second table) along with the name of
the student from the first table, related to students who have more than 75% attendance
and more than 60% marks in paper 2.
3. List all students who live in “Delhi” and have marks greater than 60 in paper 1.
4. Find the total attendance and total marks obtained by each student.
5. List the name of student who has got the highest marks in paper 2.
PRACTICAL - 3
1. Identify the Primary and Foreign Keys. Create the tables and insert following records in
each table.
Cust_ID Email Phone Reference_ID
C101 [email protected] 9891309874 C105
C102 [email protected] 9911729278 C101
C103 [email protected] 9562091819 C101
C104 [email protected] 8560272305 C104
C105 [email protected] 9871642090 C102
2. List all the customers who have the bicycles manufactured by manufacturer “Honda”.
3. List the bicycles purchased by the customers who have been referred by customer
“C101”.
4. List the manufacturer of red colored bicycles.
5. List the models of the bicycles given for service.
PRACTICAL - 4
1. Identify the Primary and Foreign Keys. Create the tables and insert following records in
each table.
Person_Name Street City
Lucy Laxmi Nagar Delhi
Kiara Hauz Khaz Bombay
Edward Saket Chennai
Alice Dwarka Bangalore
Justin Karol Bagh Hyderabad
Reva Windsor Street Manglore
John Jor Bagh Pune
Shailly Okhla Bombay
Company_Name City
Samba Bank Chennai
PWC Bombay
NCB Bank Pune
E&Y Hyderabad
Delloite Manglore
Axis Bank Delhi
ONGC Bombay
NTPC Bangalore
Person_Name Manager_Name
Kiara Edward
Justin Reva
Alice Shailly
Kiara Lucy
Alice John
2. Alter table employee, add a column “email” of type Varchar (20).
3. Find the names of all managers who work for both Samba bank and NCB bank.
4. Find the names, street address and cities of residence and salary of employees who work
for “Samba Bank” and earn more than $10,000.
5. Find the names of all employees who live in the same city as the company for which they
work.
6. Find the highest salary, lowest salary and average salary paid by each company.
7. Find the sum of salary and the number of employees in each company.
8. Find the name of the company that pays highest salaries.
PRACTICAL - 5
1. Identify the Primary and Foreign Keys. Create the tables and insert following records in
each table.
S_No S_Name Status S_City
S1 David & Co. 25 London
S2 Bruna & Co. 35 Paris
S3 Bansal & Co. 4 Delhi
S4 Swastik & Co. 20 Chennai
S5 Edward & Co. 15 London