Preview

Instructions HW1

Better Essays
Open Document
Open Document
1434 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Instructions HW1
CS 4320/5320 Homework 1
Fall 2014
Due September 17, 2014

This assignment is due on Wednesday, 9/17/2014 at 11:59pm. It is out of 65 points and counts for 10% of your overall grade.
You must work on this homework in groups of 2 or 3 students. You should make one CMS submission for your entire group, and everyone in the group will receive the same grade.
To complete the code portions of this assignment, you will need to install both MySQL
(http://dev.mysql.com/downloads/mysql/) and PostgreSQL
(http://www.postgresql.org/download/). By default we will grade your code on the current release
(stable) versions of the respective platforms; however, the functionality we are using is pretty fundamental and stable, so typically minor version differences do not lead to unexpected behavior differences.

1

SQL and Relational Algebra queries (26 points)

Consider the schema given by the following two SQL CREATE statements.
CREATE TABLE Enrolled (sid INTEGER NOT NULL, cid INTEGER NOT NULL, semesterid INTEGER NOT NULL,
PRIMARY KEY (sid, cid, semesterid));
CREATE TABLE CourseOffering (cid INTEGER NOT NULL, semesterid INTEGER NOT NULL, profid INTEGER, roomid INTEGER,
PRIMARY key (cid, semesterid));

This schema describes a simple university setting. The first table keeps track of which students are enrolled in which courses in a given semester, and each (sid, cid, semesterid) triple states that student sid takes course cid in semester semesterid. The second table keeps track of course offerings – a course offering has a course id (cid), semester id and associated info such as the profid of the professor teaching the course and the roomid of the classroom where the course meets.
Write the following queries in SQL. Each of your answers must be a single SQL query. Your SQL queries will be graded by running them in MySQL on test cases; queries that return the wrong answer will receive
1

0 points, i.e. there is no partial credit. In particular, please

You May Also Find These Documents Helpful

  • Good Essays

    This lab will utilize a set of tables found in the script file (LeeBooks.sql) found in the Doc Sharing area of the website. If you have not yet downloaded this file from Doc Sharing then do so now. Once you have downloaded the script file, import and run the script in SQL*Plus.…

    • 1559 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Unit 18 M1 Research Paper

    • 268 Words
    • 2 Pages

    Student Name Course Computer Science and IT Unit 18 Database Design Assignment Title Features of a relational databes and Testing Mia’s Sandwich Shop Database Assign 2/2 Complete this section before submitting your work: Student declaration: I certify this is my own work. Any sources I have used to assist me with this assignment are fully referenced. Student evaluation: Develop future SMART Targets.…

    • 268 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Extract the First and Last Name, Address, City, State, Zip Code and Phone Number of each senior on the database. Sort by Last Name, then First Name (1 sort).…

    • 325 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    b) 10 Convert the one table in the previous question to a relational database design. Fill each table in your…

    • 1445 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    The total set you need to design is the core set as above + a custom set designated for you as follows. Student ID ending in: 1. BNE, LUI 2. NOR, SLL 3. ADDI, LUI 4. BNE, LUI 5. NOR, LUI 6. ANDI, JR 7. BNE, LUI 8. NOR, LUI 9. ANDI, JR 0. ADDI, LUI…

    • 1082 Words
    • 5 Pages
    Good Essays
  • Good Essays

    COMMLAW LAW ASSIGNMENT

    • 653 Words
    • 3 Pages

    This assignment can be done in groups of not more than 3 (or individually). If you are working in a group please hand in one assignment only. You may work with students in another one of MY sections if you wish. PLEASE INDICATE THE NAMES OF YOUR GROUP MEMBERS CLEARLY ON THE TITLE PAGE OF THE ASSIGNMENT AND SECTION NUMBERS FOR EACH GROUP MEMBER. LATE ASSIGNMENTS ARE NOT ACCEPTED.…

    • 653 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    SQL Queries

    • 423 Words
    • 2 Pages

    These tables would be linked together by foreign keys; Enroll Table would be linked to Student table by FKStuID; Class would be linked to Enroll Table by FK ClassID…

    • 423 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Marzano unit 5

    • 1587 Words
    • 7 Pages

    Instructions: This is an honors level course. Answer all questions fully using complete sentences. If you want full credit, please provide plenty of details.…

    • 1587 Words
    • 7 Pages
    Good Essays
  • Good Essays

    A database is an integrated computer structure that stores end-user data and metadata (Coronel, Morris, & Rob, pg. 7). Data are the raw format of information, which when properly formatted can produce accurate, relevant, and timely information that is the key to making good decisions (Coronel, Morris, & Rob, pg. 5-6). The purpose of a database is to provide computer-based systems a way in which to store, manage, and retrieve data quickly (Coronel, Morris, & Rob, pg. 5). As for a local college database, the purpose of the database will be to house the data of enrolled students, the courses offered and times available, and the information of the faculty. The database can provide possible course matches for each student based off of previous courses taken and pre-requisites obtained, as well as keep track of the professors teaching each course. The database will provide the data a student needs to insure they are taking the correct courses and provide the college and the faculty general student information, such as contact information.…

    • 906 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Enrichment Unit 1

    • 417 Words
    • 2 Pages

    Instructions: This is an honors level course. Answer all questions fully using complete sentences. If you want full credit, please provide plenty of details.…

    • 417 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    assign1

    • 309 Words
    • 1 Page

    iVideo, a local video renting shop, is considering creating a database to keep track of…

    • 309 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Name and Example Output

    • 492 Words
    • 2 Pages

    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…

    • 492 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Dbm380 Course Syllabus

    • 2296 Words
    • 10 Pages

    Course Description This course covers database concepts. Topics include data analysis, the principal data models with emphasis on the relational model, entity-relationship diagrams, database design, normalization, and database administration. Policies Faculty and students will be held responsible for understanding and adhering to all policies contained within the following two documents: • • University policies: You must be logged into the student website to view this document. Instructor policies: This document is posted in the Course Materials forum.…

    • 2296 Words
    • 10 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Databases are used for record keeping and tracking of information institutions like colleges or organizations (Coronel & Morris, 2015). In this case, the database will be used to keep track of the students・attendance, performance and the courses they are supposed to be taking. This will help the college analyze how the students perform and which classes they least or most attend. The database will also help the college keep track of all the subjects which the student is taking or is expected to take in during the course. Instructors will also be part of the database. The database will track their performance in various subjects and their attendance in each class. The database will be upgraded at the beginning of every subject where each student will confirm their attendance for the particular subject and whether the instructor is in class as well. After an examination, all the students・performance will be…

    • 590 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    MySQL RefManual A

    • 635 Words
    • 5 Pages

    upgrade the server from 4.1, attempts to connect to it with an older client may…

    • 635 Words
    • 5 Pages
    Powerful Essays

Related Topics