Sie sind auf Seite 1von 2

QUESTION 1: For the following schema Write DDL queries

Table 1 : DEPT
DEPTNO (NOT NULL ,AUTO NUMBER), DNAME (VARCHAR),
LOC (VARCHAR)

Table 2 : EMP
EMPNO (NOT NULL , AUTO NUMBER), ENAME (VARCHAR),
JOB (VARCHAR), HIREDATE (DATE),
SAL (NUMBER), COMM (NUMBER), DEPTNO (NUMBER)

DEPTNO in Table 1 is primary key and foreign key in table 2, where as in table 2
EMPNO is primary key.

After Executing the above table some modifications were needed in table 2 compare
both tables and write down the modifications in queries
Table 2 : EMP
EMPNO (NOT NULL , AUTO NUMBER), ENAME (VARCHAR),
JOB (CHAR), HIREDATE (DATE), POSITION(CHAR)
SALARY (NUMBER),DEPTNO (NUMBER)
QUESTION 2: Write down the QUERIES for the following given situations.

a. Create a new data base Name it Concert.


b. Create Tables with attributes and define data type accordingly.
Insert data in related Tables (Musicians, Instruments, Album and songs) through sql insert query.

c. Create Key index on Musicians.

d. Create view Fan_View so that author whose name start with S and see only the detail of
songs.

e. Create view so that in how many different cities concert is performed.

f. Create view Name_View to get statistics for musician with id greater than 5.
Question 3: Following are the Sample data tables provided apply all required Queries.

Programmer
PName DOB DOJ Gender Proficiency1 Proficiency2 Salary

Smith 89-10-01 1-dec-2009 M Java C# 70000


Alen 82-12-31 3-feb-2013 F C++ Java 60000
Jons 95-02-03 30-oct-2007 M Pascal C# 40000
Wards 90-07-03 19-dec-2010 M C Python 50000
Amilia 82-01-29 13-aug- F Shell PHP 30000
2015
Jafsons 99-10-12 19-jul-2017 M Ruby Java 70000
Kathy 95-01-13 31-oct-2016 F Pascal java 75000
Julias 98-07-15 19-aug- F Shell Java 90000
2014

Software
PName Title DevelopedIN DCost Sold
Smith Spatial Java 30000 50000
Jons Meox Pascal 25000 40000
Amilia Ubro Shell 8000 15000
Smith Miltex Java 45000 60000
Amilia Galax PHP 5000 10000

1. List the programmers whose name is not in software table


2. How many programmers have Proficiency in JAVA.
3. How much revenue has been earned through the software developed in java.
4. What is average salary of male programmers.
5. What is Minimum salary of the programmer whose name start with “J” and end with “S”.
6. Find the number of gender and average salary for each gender.
7. List the detail of software’s which are developed after 2010.
8. Create a view “STATUS” for customers so that they can see only detail of software and
proficiencies of programmers.
9. How many languages known by male programmers
10. Update the complete detail of programmers who are born in current month

Das könnte Ihnen auch gefallen