Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL datbase(sql)
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


arvind
datbase(sql)
1 Answer(s)      4 years ago
Posted in : 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.


Advertisement
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;



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
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
Advertisements
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  hii What is sql?   hello, SQL, which stands for Structured Query Language, is a special-purpose language used to define, access, and manipulate data. SQL is non procedural, meaning that it describes
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
, user events, and SQL statements to subscribing applications 10)Restrict DML
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
tables EMP, and DEPT, the structure for which are given above. Write SQL queries
sql - SQL
order by SQL Query  What is order by in SQL and when this query is used in SQL?Thanks!  Hi,In case of mysql you can user following query.Select salary from salary_table order by salary desc limit 3,1Thanks
sql - SQL
want query? 4.what is the diffrence between sql and plsql?  Hi Friend... HAVING n>1; Difference between SQL and PL/SQL: SQL is a structured query...(select,insert,update etc.), manipulate objects(DDL) and data(DML). PL/SQL
sql - SQL
sql  write a dyamic sql program to display the name of a employee whose salary is <5000  Hi Friend, Use the following query... the following link: http://www.roseindia.net/sql/ Thanks
SQL - SQL
SQL  How to combine 'LIKE' and 'IN' operators in sql query?   select name from tab1 where name like 'R%' AND city in('bangalore','mumbai'); Table Name: tab1 FieldName ===================== | name | city
SQL - SQL
SQL  Jus c da case we hve certain images in some folder or some area in sql can we create trigger or procedure so dat in front like in asp page while clicking image it will be showed in page ...... ...I mean writing code for each
sql - SQL
sql functions with examples  I need sql functions with examples to learn fast.  Hi friend,<%@ page language="java" import...("SQL statement is not executed!"); } } catch (Exception e
sql server - SQL
sql server  what is SQL server? & what is oracle? are they same
sql server - SQL
sql server  How many no of tables can be joined in same sql server
SQL help - SQL
SQL help  Hi Deepak, Can u pls tell me what is the difference between PL/SQL and MYSQL? Is there any difference in generating the code
SQL JOINS - SQL
SQL JOINS  Hom many Joins In Sql?plz explian all those things?  Hi Friend, Please visit the following link: http://www.roseindia.net/sql/sqljoin/index.shtml Hope that it will be helpful for you. Thanks
sql component
sql component  is sql package is the component of jdbc
An SQL Locator.
An SQL Locator.  What is an SQL Locator
 

 

 

DMCA.com