0% found this document useful (0 votes)
40 views3 pages

Admn - No Sname Gender DOB Stream Marks

1. The document contains practical SQL questions on creating and manipulating tables. 2. Questions include writing programs for stack operations, creating and inserting into tables, and executing queries to select, insert, update and manipulate data from multiple tables. 3. The questions cover concepts like primary keys, foreign keys, data types, joins, sorting, filtering, aggregations and more.

Uploaded by

Samar Patil
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)
40 views3 pages

Admn - No Sname Gender DOB Stream Marks

1. The document contains practical SQL questions on creating and manipulating tables. 2. Questions include writing programs for stack operations, creating and inserting into tables, and executing queries to select, insert, update and manipulate data from multiple tables. 3. The questions cover concepts like primary keys, foreign keys, data types, joins, sorting, filtering, aggregations and more.

Uploaded by

Samar Patil
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/ 3

Practical Questions -Practice

1. Write Program to add (PUSH) elements to the stack. (2 Marks)


2. Write a program to remove (POP) the elements from the stack. (2 Marks)
3. Write a program to create following table “Class12” in database “aps” using python
interface with SQL. (2 Marks)

Field Data Type Size Constraint


admn_no int 4 primary key
sname varchar 30
gender char 1
DOB date
stream varchar 15
marks int 3

4. Write a program to insert value in “Class12” table using python interface with SQL.
Consider “Class12” table is created in the database “aps” (2 Marks)
Class12

admn_no sname gender DOB stream marks


1000 Arushi Dutta F 2003-10-04 Science 67.34

5. Consider the table Employee table given below. Write commands in SQL for the following
questions. (4 Marks)
Employee

Field Type Constraints


Ecode Int Primary key
EName Varchar(20) NOT NULL
Dept Varchar (15)
City Varchar(15)
Gender Char(1)
DOB Date
Salary Float(12,2)

Ecode Ename Dept City Gender DOB Salary


1 Rakesh Sharma Productions Surat M 1980-07-01 25000
2 Jugal Mittal Marketing Mumbai M 1985-01-01 38000
3 Sangeeta Vats HR Banglore F 2000-12-05 40000
4 Reena Mehta Sales Delhi F 1994-09-11 36000
5 Ashok Singhal Productions Delhi M 1989-03-04 28000
(i) Execute a query to create above table according to the given structure
(ii) Execute a query to insert above values in Employee table.
(iii) Find the name and salary of those employees whose salary is between 35000 and
40000.
(iv) Display the name of departments. Each department should be displayed once.
(v) SELECT Dept, avg(salary) FROM EMPLOYEE group by Dept;
(vi) SELECT Ename FROM EMPLOYEE WHERE Ename LIKE 'R%';

6. Consider the table Projects given below. Write commands in SQL for the following
questions. (4 Marks)

Projects
Field Name ID ProjName ProjSize Cost Startdate
(Primarykey)
Data type Integer Varchar Varchar Integer Date
Length 4 30 20 5
ID ProjName ProjSize Cost Startdate

1 Payroll-MMS Medium 60000 2000-12-12

2 Payroll-ITC Large 500000 1999-07-01

3 IDMgmt-LITL Large 300000 2007-11-26

4 Recruit-LITL Medium 50000 2011-05-11

5 IDMgmt-MTC Small 20000 2020-12-31

(i) Create table according to the above structure given.


(ii) Execute the query to insert values in to the table Projects.
(iii) SELECT * FROM projects WHERE ProjSize=”Medium”;
(iv) SELECT ID,ProjName,ProjSize,Cost FROM projects ORDER BY startdate DESC;
(v) Execute a query to count the number of projects of cost less than 100000.
(vi) To list the ProjSize of projects whose ProjName ends with LITL.

7. Consider the table voter given below. Write commands in SQL for the following questions.
(4 Marks)
Voter
(i) Write SQL query to create the Voter table.
(ii) Write a query to insert values in to Voter Table.
(iii) Write the SQL query to display the information of all voters whose name ends
with alphabet H.
(iv) Write the SQL query to display the information of all voters in descending order
of Age.
(v) Select count(*) from voter where age<40;
(vi) select votername, city from voter where city in(“Surat”,” Mumbai”, “Banglore”);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy