Preview

Name and Example Output

Satisfactory Essays
Open Document
Open Document
492 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Name and Example Output
Chapter 2 Part 2 Kroenke Questions

grades(zid,cl_id, grade) faculty(fid, fname, lname, zipcode, email_address) zip(zipcode, city, state) courses(c_num, course_name, course_description, credit_hrs) classes(cl_id, c_num, fid) student(zid, fname, lname, zipcode, email_address, adv_id)

with the following referential integrity courses(c_num) -> classes(c_num) student(zid) -> grades(zid) classes(cl_id) -> grades(cl_id) faculty(fid) -> classes(fid) faculty(fid) -> student(adv_id) zip(zipcode) -> student(zipcode) zip(zipcode) -> faculty(zipcode)

Use the above information to create queries for the following questions

1) Display the the name of each student and what zipcode they live in. sort them by last and then first name in ascending order

Example output data
John James lives in 60543
Matt James lives in 60122
April Harmon lives in 60115
Ans: SELECT fname, lname +’ lives in ‘ + , Zipcode FROM student ORDERBY lname, fname;

2) Write a query to display the Student id and the number of grades they have received ***

example output

z12345 7 z14325 12 z11674 2
Ans: SELECT s.Zid, count(g.grades) FROM student s, grade g WHEREns.zid=g.zid FROM grades

3) Find the names of faculty that do not live in one of the following 3 zipcodes. 60543, 60234, 60012. use not in ***
Ans: SELECT fname,lname FROM faculty WHERE Zipcode not in (’60543’, ’60234, ‘60012’);

4) Find the names of courses that have the word Database in the course Description
Ans: SELECT course_name FROM courses WHERE course_description LIKE “* Database * “

5) Find the names of students who have a last name that starts with a N
Ans: SELECT fname,lname FROM student WHERE lname LIKE “N*”

6) Find the names of students that live in one of the following 4 zipcodes. 60543, 60115, 60234, 60012. use in
Ans: SELECT fname,lname FROM

You May Also Find These Documents Helpful

  • Good Essays

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

    • 1542 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Nt1310 Unit 3 Assignment

    • 256 Words
    • 2 Pages

    Write a program to read the name of 5 students through keyboard and store them in a file “name.txt”.…

    • 256 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Display the contents of the file GRADES created in Problem 1. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student. For example a line output might be:…

    • 349 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    It 210 Week 7

    • 286 Words
    • 2 Pages

    2. Display the contents of the file GRADES created in Problem 1. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student. For example, a line of output might be as follows:…

    • 286 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Fba Sample

    • 2375 Words
    • 10 Pages

    Student __Thomas Jones__________________________ Age ___13_____ Sex ___M____Teacher(s) __Ms. Gilbow / Team B______________________ Grade ____6th___________Case Manager _Mrs. Brantley____________________________ Date(s) ___4/17/00_____…

    • 2375 Words
    • 10 Pages
    Better Essays
  • Satisfactory Essays

    4. If you were preparing a spreadsheet to share information about the names of students and their grades on a test, how would you organize the information into rows and columns? Give at least one reason to explain your answer. Explain in 2-5 sentences. (3.0 points)…

    • 344 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Reading Philosophies

    • 1651 Words
    • 7 Pages

    | |students in the classroom. |and then will present it in front of the class |Mind mapping will have the students list and |…

    • 1651 Words
    • 7 Pages
    Powerful Essays
  • Powerful Essays

    Logical Database Design

    • 1722 Words
    • 7 Pages

    CIT 214 – Assignment 1 – Logical Database Design, The Big Boys and Girls Gym Database…

    • 1722 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Yuka Koyama uses the Pinehill database to maintain information about the students, teachers, and contracts for her music school. Yuka asks you to help her build the database by updating one table and creating two new tables.…

    • 1090 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    Ffaaa

    • 14295 Words
    • 58 Pages

    As the head of information systems for Wylie College you are tasked with developing a new student registration system. The college would like a new client-server system to replace its much older system developed around mainframe technology. The new system will allow students to register for courses and view report cards from personal computers attached to the campus LAN. Professors will be able to access the system to sign up to teach courses as well as record grades. Due to a decrease in federal funding, the college cannot afford to replace the entire system at once. The college will keep the existing course catalog database where all course information is maintained. This database is an Ingres relational database running on a DEC VAX. Fortunately the college has invested in an open SQL interface that allows access to this database from college’s Unix servers. The legacy system performance is rather poor, so the new system must ensure that access to the data on the legacy system occurs in a timely manner. The new system will access course information from the legacy database but will not update it. The registrar’s office will continue to maintain course information through another system. At the beginning of each semester, students may request a course catalogue containing a list of course offerings for the semester. Information about each course, such as professor, department, and prerequisites, will be included to help students make informed decisions. The new system will allow students to select four course offerings for the coming semester. In addition, each student will indicate two alternative choices in case the student cannot be assigned to a primary selection. Course offerings will have a maximum of ten students and a minimum of three students. A course offering with fewer than three students will be…

    • 14295 Words
    • 58 Pages
    Powerful Essays
  • Powerful Essays

    Time Table Generation

    • 2264 Words
    • 10 Pages

    The StudentsGroup class has an ID and the name of the student group, as well as the number of students (size of…

    • 2264 Words
    • 10 Pages
    Powerful Essays
  • Satisfactory Essays

    I did find 2 students names who were different from the excel sheet compared to the list provided to Mrs. DePiero - please see below:…

    • 352 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    5) Make a desktop application for adding and searching student record. All data will be saved in CV…

    • 2087 Words
    • 24 Pages
    Satisfactory Essays
  • Powerful Essays

    1. Census of student population and estimates of student population both long-range-and short-range, must be made.…

    • 2159 Words
    • 9 Pages
    Powerful Essays
  • Satisfactory Essays

    Revision

    • 772 Words
    • 4 Pages

    _______________________________________________ BESTLINK COLLEGE OF THE PHILIPPINES 1044 Brgy. Sta. Monica, Quirino Hi-way, Novaliches, Quezon City Design & Evaluation Of Student Information Database Management System A Project Proposal Presented to The Faculty of the Information Technology Department Bestlink College of the Philippines Novaliches, Quezon City In Partial Fulfillment Of the requirement in Associate in Computer Technology Members:…

    • 772 Words
    • 4 Pages
    Satisfactory Essays

Related Topics