datbase(sql)

datbase(sql)

EMP
EMP_NO NOT NULL NUMBER(4) EMP_NAME VARCHAR(25) DESIGNATION CHAR(4) JOINING_DATE DATE SALARY NUMBER(7,2) DEPT_NO NUMBER(2)

DEPT
DEPT_NO NOT NULL NUMBER(2) DEPT_NAME VARCHAR(25) BUDGET NUMBER(15,2) MANAGER VARCHAR(25)

Create tables EMP, and DEPT, the structure for which are given above.

Write SQL queries for the following :

  1. Display each employee‚??s name and date of joining.

  2. Display employees earning more than Rs.5,000. Label the column name ‚??Employee‚??.

  3. Display all employee names and employee numbers in the alphabetical order of names.

  4. Display all employee names containing the letter ‚??S‚??.

  5. Display the employees hired in 1981.

  6. Display the minimum and maximum salary.

  7. Display the list of employees along with their department name and its manager.

  8. Display the number of different employees listed for each department.

  9. Delete the records of all the employees hired in 1981 from EMP table.

  10. Update the salary of all the employees to Rs. 10,000.

View Answers

January 3, 2011 at 7:00 PM

  1. select EMPNAME, JOININGDATE from emp

  2. select EMP_NAME as Employee from emp where SALARY>5000

  3. select EMPNAME, EMPNO from emp order by EMP_NAME

  4. select EMPNAME from emp where EMPNAME like "%ra%"

  5. select EMPNAME from emp where YEAR(JOININGDATE)=1981

  6. select min(SALARY), max(SALARY) from emp

  7. select e.EMPNAME, d.DEPTNAME, d.MANAGER from emp e, dept d where e.DEPTNO=d.DEPTNO

  8. select count(*), d.DEPTNAME from emp e, dept d where e.DEPTNO= d.DEPTNO group by e.DEPTNO

  9. delete from emp where YEAR(JOINING_DATE)=1981

  10. update emp set SALARY=10000;

Ads









Related Tutorials/Questions & Answers:
datbase(sql)
datbase(sql)  EMP EMP_NO NOT NULL NUMBER(4) EMP_NAME VARCHAR(25) DESIGNATION CHAR(4) JOINING_DATE DATE...) Create tables EMP, and DEPT, the structure for which are given above. Write SQL
how to insert excel file into mysql datbase in servlet
how to insert excel file into mysql datbase in servlet  emphashow to insert excel file into mysql datbase inservletized text
Advertisements
Retrieve The Data From MySql Datbase
Retrieve The Data From MySql Datbase   How to Retrieve The Data From MYSQL database TO Use Select the Emp_id Option.And Also Search Option
jsp to cassandra datbase connection by using eclipse
jsp to cassandra datbase connection by using eclipse  sir i want to connect the apache cassandra datbase by using cql query language. i am success by using simple java application.now my task is to interact with cassandra
sql
difference between sql and oracle  what is the difference between sql and oracle
sql
sql  how to get first row in sql with using where condition in sql? how to get last row in sql with using where condition in sql
sql
sql  I want interview sql questions   Please visit the following link: SQL Tutorials
Sql
Sql  how to find maximum of a101,a102,a103 from a table in sql
sql
sql  returning value from a store procedure in sql with example   Please visit the following links: http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml http://www.roseindia.net/sql/create
SQL
SQL  In my computer i have microsoft sql 2008.how can i set that in the cmd.i want to use that in cmd.what is the default username and password
SQl
SQl  . Given two tables: table1(player, groundname, numcenturies); table2(ground_name, country); Write and SQL query for the following: " Select all the players from table1 who has
SQL
SQL   1)How to Store 1000 records in Oracle object. 2)Write a query for calculate highest, 3rd Highest & 10th highest salary from emp teble. 3)What is Sequence. 4)How to use rowid in Sql. 5)What is Views. 6)How
SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM
SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM
SQL
SQL Trigger query  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed..., user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
tables EMP, and DEPT, the structure for which are given above. Write SQL queries
SQL
events, user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
events, and SQL statements to subscribing applications 10)Restrict DML
SQL
, user events, and SQL statements to subscribing applications 10)Restrict DML
sql component
sql component  is sql package is the component of jdbc
sql 2000 - SQL
sql 2000  why binary data when inserted into the sql column of data type image or binary is stored in the form of hexadecimal nos. instead of the name of the file inserted????? Thanx for ur response in advance
auto sql script - SQL
auto sql script  Is there a way of generating inserts scripts using the table structure for oracle database
sql quries
sql quries  i want basic sql quries please provide
SQL
SQL       SQL SQL is an English like language consisting of commands to store, retrieve, maintain & regulate access to your database. SQL*Plus SQL*Plus
sql and .net
sql and .net  I want get coding of connecting data base sql server 2000 to .net please help
Sql to excel
Sql to excel  How to convert a Sql Data into excel Doc with Using Netbeans
Sql question
Sql question  How to display duplicate values in Sql?   Hi Friend, Please visit the following link: http://www.roseindia.net/sql/mysql-example/mysql-finding-duplicate-records.shtml Thanks
sql-jdbc
sql-jdbc  how to execute select query using prepared statement
php sql problem - SQL
php sql problem  I ahve a php code that doesn't allow me to get the vat value from db. i tried to add $vat = 21; below $shippingCost = 10; but doesn't work. why?? The vat is not returning any values.   Hi friend
sql database
sql database  how to upload image in website give asp.net code fot that   how to get difference of two date in year in sql database
Sql Query
Sql Query  Is this query work in Db2 or not ? Select * from FORUM LIMIT 2

Ads