Assignment 6-7.doc - Chapter 6 SQL Course Query Assignment...

This preview shows page 1 - 3 out of 7 pages.

Chapter 6 SQL Course Query Assignment Go to: and Develop and execute SQL statements at the site address above that do the following and submit a copy of the query used under each select activity below: 1. Display all fields and contents in the ‘empinfo’ table. select * from empinfo 2. Display first, last, and age for first names beginning with Mary from the ‘empinfo’ table. select first, last, age from empinfo where first='Mary’; 3. Select statement that will match any last names that end in an 'ay' from the ‘empinfo’ table select * from empinfo where last LIKE '%ay'; 4. Display first, last, and id for all records within state California from the ‘empinfo’ table. Select first, last, id from empinfo where state='California'; 5. Display last name, age, and state columns for all employees whose age is less than 30 from ‘empinfo’ table . Select last, age, state from empinfo where age<30; 6. Display the first name, last name, and city for everyone that's not from California. Select first, last, city from empinfo where state<>'California'; 7. Display all columns for everyone whose id begins with 9. select * from empinfo where id like '9%'; 8. Display the first and last names for everyone whose last name ends in an "ver". select first, last from empinfo where last like '%ver'; 9. Display all columns for everyone whose last name equals "Jones". select * from empinfo where last ='Jones'; 10. Display all columns for everyone whose last name contains "Ed". select * from empinfo where last like '%Ed%';
Image of page 1

Subscribe to view the full document.

11. Display everyone's first name, last name, and id for everyone younger than 40.\ Select first, last, id from empinfo where age<40; 12. Display the first name, last name, and city for everyone that's not from the city Tucson. select first, last, city from empinfo where city <> 'Tucson'; 13. Display the first name, last name, and city for everyone whose age equals 22. select first, last, city from empinfo where age=22; 14. Display the first name, last name, and id for everyone from the city Phoenix select first, last, id from empinfo where city='Phoenix'; 15. Create a table with a unique name (of your choice) that will contain the following information about employees: firstname, lastname, department, office, job, age, and salary. Assume data types as desired for the table. After you create the table, you should receive a small form on the screen with the appropriate column names displayed. Keep a record of the table name for the following activities. create table DungThan (firstname vchar(20), lastname vchar(20), department vchar(20), office vchar(20), job vchar(20), age number(2), salary number()); 16. Insert data into your newly created table. Enter three employees information as follows into the table you created: Jonie Weber, Admin Dept, Tax Office, Secretary, 24, 19500.00 insert into DungThan (firstname, lastname, department, office, job, age, salary) values ('Jonie', 'Weber', 'Admin Dept', 'Tax Office', 'Secretary', 24, 19500.00);
Image of page 2
Image of page 3
  • Fall '17
  • Barson
  • Personal name, Family name, Given name, CustomerID

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern