Preview

SQL: Queries

Powerful Essays
Open Document
Open Document
6089 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
SQL: Queries
SQL-QUERIES 1. Display all the information of the EMP table? A) select * from emp; 2. Display unique Jobs from EMP table? A) select distinct job from emp; B) select unique job from emp; 3. List the emps in the asc order of their Salaries? A) select * from emp order by sal asc; 4. List the details of the emps in asc order of the Dptnos and desc of Jobs? A)select * from emp order by deptno asc,job desc; 5. Display all the unique job groups in the descending order? A)select distinct job from emp order by job desc; 6. Display all the details of all ‘Mgrs’ A)Select * from emp where empno in ( select mgr from emp) ; 7. List the emps who joined before 1981. A) select * from emp where hiredate < (’01-jan-81’); 8. List the Empno, Ename, Sal, Daily sal of all emps in the asc order of Annsal. A) select empno ,ename ,sal,sal/30,12*sal annsal from emp order by annsal asc; 9. Display the Empno, Ename, job, Hiredate, Exp of all Mgrs A) select empno,ename ,job,hiredate, months_between(sysdate,hiredate) exp

from emp where empno in (select mgr from emp); 10. List the Empno, Ename, Sal, Exp of all emps working for Mgr 7369. A) select empno,ename,sal,exp from emp where mgr = 7369; 11. Display all the details of the emps whose Comm. Is more than their Sal. A) select * from emp where comm. > sal; 12. List the emps in the asc order of Designations of those joined after the second half of 1981. A) select * from emp where hiredate > (’30-jun-81’) and to_char(hiredate,’YYYY’) = 1981 order by job asc; 13. List the emps along with their Exp and Daily Sal is more than Rs.100. A) select * from emp where (sal/30) >100; 14. List the emps who are either ‘CLERK’ or ‘ANALYST’ in the Desc order. A) select * from emp where job = ‘CLERK’ or job = ‘ANALYST’ order by job desc;

15. List the emps who joined on 1-MAY-81,3-DEC-81,17-DEC-81,19-JAN-80 in asc order of seniority. A) select * from emp where hiredate in (’01-may-81’,’03-dec-81’,’17-dec81’,’19-jan-80’) order by hiredate asc; 16. List the emp

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Hiredate DATE No No Job VARCHAR2(15) No No Mgrno number(4) no no yes ( to emp.empno) Salary number(8,2) no no Comm number(8,2) no no Deptno number(2) no no yes ( to…

    • 1169 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    2. SELECT e.ename, e.deptno, d.dname, d.deptno FROM emp e LEFT OUTER JOIN dept d ON e.deptno = d.deptno ORDER BY e.deptno, e.ename; SQL> SELECT e.ename, e.deptno, d.dname, d.deptno 2 FROM emp e 3 LEFT OUTER JOIN dept d 4 ON e.deptno = d.deptno 5 ORDER BY e.deptno, e.ename; ENAME DEPTNO DNAME DEPTNO ---------- ----------…

    • 1542 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    EmpID = Employees. EmpID where WorkHours. WH_Day between 1 and 7 and WorkHours. WH_Month = 4 group by Employees.…

    • 485 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Ocean Lab Report

    • 853 Words
    • 4 Pages

    Our data has two tables because it contains data from two classes. First data is from Wednesday 19th (T-1), which is our class and the other data is…

    • 853 Words
    • 4 Pages
    Better Essays
  • Satisfactory Essays

    Mis562 Week 2

    • 2131 Words
    • 9 Pages

    SQL> SELECT ENAME, JOB, SAL FROM EMP WHERE EMPNO NOT IN (SELECT MGR FROM EMP WHERE MGR IS NOT NULL) OR SAL > 1000;…

    • 2131 Words
    • 9 Pages
    Satisfactory Essays
  • Powerful Essays

    Unit 18 - Database P1, M1

    • 995 Words
    • 4 Pages

    A query is use for searching some specific record. It allow user to set conditions and then search the record which match the conditions. User also is able to make the search mix up with other table and sort the order of the result.…

    • 995 Words
    • 4 Pages
    Powerful Essays
  • Good Essays

    Unit 53 Final Paper

    • 383 Words
    • 2 Pages

    6. Create a query that displays the first eight characters of the employees’ last names and indicate the amount of their salaries with asterisks. Each asterisk signifies a thousand dollars. Sort the data in descending order of salary. Label the column as EMPLOYEES_AND_THEIR_SALARIES.…

    • 383 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Pt1420 Final Exam

    • 527 Words
    • 3 Pages

    | Formulate an SQL statement to insert a new record into the PirmariiTb table with the values 'Heemstede', ‘Gerda Otto', '0760072008' and 'Sasolburg'. Display all the records and fields in the PirmariiTb table after the new record has been added.…

    • 527 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    SQL Queries

    • 423 Words
    • 2 Pages

    Given the table information above, if you were asked to create an Access query that showed the Student Name and Grade for all students taking a class in Room H201, what tables would you need and how would you link them together?…

    • 423 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Chapter 1 Level 1

    • 689 Words
    • 3 Pages

    Name the Employee and Customer tables according to their contents and the Leszynski/Reddick naming conventions.…

    • 689 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    By the database, we know that 11 people from the department 1; 100 people from the department 2; 177 people from the department 3; So,…

    • 1009 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    You are responsible for managing information system development projects at AAA Systems. To better track progress in completing projects,you have decided to maintain a simple database table to track the time your employees spend on various tasks and projects with which they are associated. It will also allow you to keep track of employees' billable hours each week. The table below provides a sample data set.…

    • 255 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Paper

    • 315 Words
    • 2 Pages

    b. Which faculty members have qualified to teach a course since 1993? List the faculty ID, course, and date of qualification. (pg 271)…

    • 315 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Tugas Akhir

    • 2292 Words
    • 10 Pages

    Hasil Seleksi Proposal Tugas Akhir Program Studi Manajemen Informatika KELAS : MI IIIA NO NAMA NO BP JUDUL TUGAS AKHIR PEMBIMBING I PEMBIMBING II KETERANGAN 1 SISKA TRIA WULANDARI 06 091 001 SISTEM INFORMASI RUMAH SAKIT SANTA MARIA PEKANBARU RIAU DENGAN MENGGUNAKAN JAVA 2 SE DAN MYSQL RITA AFYENNI,M.KOM ADE IRMA SURYANI,ST,S.ST REVISI JUDUL (PERANCANGAN DAN IMPLEMENTASI) DAN RUANG LINGKUP DIPERJELAS 2 AKBAR NOVISMAL PUTRA 06 091 003 SISTEM INFORMASI SANGGAR KEGIATAN BELAJAR (SKB) PADANG TIMUR DENGAN MENGGUNAKAN JAVA 2 SE DAN MYSQL RIKA IDMAYANTI,ST YANCE SONATHA,S.KOM REVISI JUDUL (PERANCANGAN DAN IMPELEMNTASiI) DAN RUANG LINGKUP DIPERJELAS 3 ANDIKA 06 091 007 APLIKASI SISTEM INFORMASI LABORATORIUM DI SEKOLAH MENENGAH ANALISIS KIMIA PADANG DENGAN MENGGUNAKAN JAVA 2 SE DAN MYSQL YANCE SONATHA,S.KOM RASYIDAH, S. SI, MM REVISI JUDUL (PERANCANGAN DAN IMPLEMENTASI) 4 ANIKA RAHMI 06 091 009 SISTEM INFORMASI AKADEMI D3 KEBIDANAN BUKITTINGGI MERI AZMI,ST YULHERNIWATI,MT REVISI JUDUL (PERANCANGAN DAN IMPLEMENTASI) DAN RUANG LINGKUP DIPERJELAS 5 TAUFIK GUSMAN 06 091 011 MULTIMEDIA INTERAKTIF BERBASIS ANIMASI TATA CARA PELAKSANAAN IBADAH HAJI LENGKAP MENGGUNAKAN MACROMEDIA FLASH 8 DRS. ERWADI BAKAR, M. KOM RITA AFYENNI,M.KOM REVISI JUDUL (JUDUL DIPERTEGAS) 6 GANDA ARIZAL 06 091 013 SISTEM MANAJEMEN DABATASES DALAM PENGOLAHAN DATA KARYAWAN PADA KANTOR FAVORIT TV DENGAN MENGGUNAKAN JAVA 6.1 DITOLAK (BAHASAN KURANG JELAS) 7 MINDA LADIA 06 091 015 SISTEM INFORMASI PENGOLAHAN DATA PELATIHAN KETENAGAKERJAAN PADA DINAS SOSIAL TENAGA KERJA DAN PEMBERDAYAAN MASYARAKAT KOTA BUKITTINGGI DENGAN MENGGUNAKAN JAVA 2 SE DAN MYSQL RASYIDAH, S. SI, MM MERI AZMI,ST REVISI JUDUL (PERANCANGAN DAN IMPLEMENTASI SISTEM INFORMASI PELATIHAN) DAN RUANG LINGKUP DIPERJELAS 8 NONA ANDRIA ULFAH 06 091 017 SISTEM INFORMASI SHOWROOM SUZUKI BATU SANGKAR DENGAN…

    • 2292 Words
    • 10 Pages
    Satisfactory Essays
  • Powerful Essays

    Business Studies 2015 XII

    • 23108 Words
    • 87 Pages

    1. Mr. Ram, Mr. Rahim and Mr. Joy are the production managers of three different…

    • 23108 Words
    • 87 Pages
    Powerful Essays

Related Topics