Preview

Student: Name and Example Output

Satisfactory Essays
Open Document
Open Document
400 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Student: Name and Example Output
Homework Chapter 2 Part 2 Name ____________________
ZID# _________________
GIVEN the following tables and relationships

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

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

SELECT s.zid, count (g.grade)
FROM student s, grades g
WHERE s.zid=g.zid;

3) Find the names of faculty that do not live in one of the following 3 zipcodes. 60543, 60234, 60012. use not in ***

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

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

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

SELECT fname, lname
FROM student
WHERE zipcode in (‘60543’, ‘60234’,’60012’);

You May Also Find These Documents Helpful

  • Good Essays

    Nt1330 Unit 4

    • 1142 Words
    • 5 Pages

    database of student grades so that only students who made an 85 or higher are displayed.…

    • 1142 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    MAT 126 Week 1 Quiz

    • 767 Words
    • 4 Pages

    1. In a survey of 24 college students, it was found that 16 were taking an English class, 17 were taking a math class, and 10 were taking both English and math. How many students were taking a math class only?…

    • 767 Words
    • 4 Pages
    Satisfactory 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

    3. You need to count the number of students with last names beginning with the same letter. For example, count all students with last names beginning with A, then count last names beginning with B, etc. Simply adding a Subtotal function to the worksheet will result in completely useless results since the data is not categorized yet.…

    • 432 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 1 Assignment

    • 2064 Words
    • 9 Pages

    Student C: (………………..Put your own name & School ID #, Group #(1,2,3,4), University group (P,H,C,Y) here)…

    • 2064 Words
    • 9 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
  • Good Essays

    Employment and Flag Question

    • 2097 Words
    • 20 Pages

    b. List each school separately, spelling out the complete and full name of all institutions…

    • 2097 Words
    • 20 Pages
    Good Essays
  • Satisfactory Essays

    SQL Queries

    • 423 Words
    • 2 Pages

    Query 2: Find the ClassID of all classes in which students are enrolled. The result should be a one column table, and no ClassID should appear more than once in that column.…

    • 423 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Miss

    • 400 Words
    • 2 Pages

    Using well labelled diagrams create 2, 2 fold leaflets outlining the stages of Mitosis and Meiosis. You need to create one leaflet for each (P2).…

    • 400 Words
    • 2 Pages
    Satisfactory 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
  • Satisfactory Essays

    CTS 2437 Final Exam

    • 630 Words
    • 4 Pages

    1. Select the number of courses that have more than 20 persons enrolled, the total number of students in courses with more than 20 persons, and the average enrollment per each course with more than 20 persons.…

    • 630 Words
    • 4 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
  • Good Essays

    table based on data in another table. They generally are used when tables have some kind…

    • 1885 Words
    • 8 Pages
    Good Essays
  • Good Essays

    Kudler Fine Foods wants to convert the Chart of Accounts sheet in Excel to an SQL database. In order to do so, it is important to format the excel data in proper SQL tables. Normalization plays an important part in placing data fields in proper tables.…

    • 480 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    2- Student can choose to be identified by name on schedule or by some of other identified…

    • 829 Words
    • 4 Pages
    Satisfactory Essays

Related Topics