Preview

Dbm End of Chapter Solution 6

Satisfactory Essays
Open Document
Open Document
485 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Dbm End of Chapter Solution 6
1. Write a database description for each of the relations shown, using SQL DDL. CREATE TABLE Student_T (StudentID INTEGER NOT NULL, StudentName VARCHAR2(25),CONSTRAINT Student_PK PRIMARY KEY (StudentID));CREATE TABLE Faculty_T (FacultyID INTEGER NOT NULL, FacultyName VARCHAR2(25),CONSTRAINT Faculty_PK PRIMARY KEY (FacultyID));CREATE TABLE Course_T (CourseID CHAR(8) NOT NULL, CourseName VARCHAR2(15),CONSTRAINT Course_PK PRIMARY KEY (CourseID));CREATE TABLE Qualified_T (FacultyID INTEGER NOT NULL, CourseID CHAR(8) NOT NULL, DateQualified DATE,CONSTRAINT Qualified_PK PRIMARY KEY (FacultyID, CourseID),CONSTRAINT Qualified_FK1 FOREIGN KEY (FacultyID) REFERENCES Faculty_T(FacultyID),CONSTRAINT Qualified_FK2 FOREIGN KEY (CourseID) REFERENCES Course_T(CourseID));CREATE TABLE Section_T (SectionNo INTEGER NOT NULL, Semester CHAR(7) NOT NULL, CourseID CHAR(8) NOT NULL,CONSTRAINT Section_PK PRIMARY KEY (SectionNo, Semester, CourseID),CONSTRAINT Section_FK FOREIGN KEY (CourseID) REFERENCES Course_T(CourseID));CREATE TABLE Registration_T (StudentID INTEGER NOT NULL, SectionNo INTEGER NOT NULL, Semester CHAR(7) NOT NULL,CONSTRAINT Registration_PK PRIMARY KEY (StudentID, SectionNo, Semester),CONSTRAINT Registration_FK1 FOREIGN KEY (StudentID) REFERENCES Student_T(StudentID),CONSTRAINT Registration_FK2 FOREIGN KEY (SectionNo) REFERENCES Section_T(SectionNo),CONSTRAINT Registration_FK3 FOREIGN KEY (Semester) REFERENCES Section_T(Semester)); |

4. Write SQL data definition commands for each of the following queries:
a. How would you add an attribute, Class, to the Student table?
ALTER TABLE Student_T
ADD COLUMN Class;

b. How would you remove the Registration table?
DROP TABLE Registration_T;

c. How would you change the FacultyName field from 25 characters to 40 characters?
ALTER TABLE Faculty_T
ALTER COLUMN FacultyName TYPE VARCHAR2(40);

6. Write SQL queries to answer the following questions: a. Which students have an ID number that is less than

You May Also Find These Documents Helpful

  • Satisfactory Essays

    PT2520 Unit7Labs Tramil

    • 330 Words
    • 1 Page

    3. What is a foreign key? This primary key becomes a foreign key when it is repeated in another table to create a link between the tables.…

    • 330 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    It203 Homework 5

    • 319 Words
    • 2 Pages

    In the table design view, right click the column name of the entity you want to create a relationship with and then select "Relationships" which opens the Properties window with the Relationships tab selected. Click on "New" and then verify the "Primary key table" and "Foreign key table". Select the primary key from the grid below the "Primary key table" name (left side of grid) and then select the column name you right-clicked on earlier from the grid below the " Foreign key table" name (right side of grid). Selecting each one in turn sets the two into the desired relationship.…

    • 319 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    No Ans: CREATE TABLE dept (deptno NUMBER(2) NOT NULL, dname VARCHAR2(30) NOT NULL, loc VARCHAR2(20) CONSTRAINT deptno_pk PRIMARY KEY (deptno)); b. Table name: EMP i. Column datatype Mandatory? PK? FK?…

    • 1169 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    # Select a primary key for each table as indicated in the provided ERD diagram.…

    • 694 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    BSOP 429 Midterm Exam 1

    • 375 Words
    • 2 Pages

    8. (TCO 5) The amount of time covered by the basic MRP record is called the _____.…

    • 375 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Create a one-to-many relationship between the Department field in the Department Managers table and the Department Field in the Volunteers table, being sure to enforce referential integrity. Close the Relationships window, saving the changes.…

    • 402 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt2520 Final Answers 1/3

    • 329 Words
    • 2 Pages

    what best describes the function of a foreign key. the primary key repeated in another table to show relation…

    • 329 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    cis3730_Exam1_Studyguide

    • 512 Words
    • 2 Pages

    Given a table or a set of tables, be able to specify their primary keys and foreign keys.…

    • 512 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Defining a(n) primary key in a second table creates a relationship between that table and the table where the primary key was first defined. _________________________…

    • 585 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Com203 Db1 Part 2

    • 651 Words
    • 2 Pages

    Have you ever asked yourself when sending a message through e-communication; Is the person receiving and reviewing the message going to understand the information? The encoders’ role is to relay a message accurately and be knowledgeable on the information being sent. On the receiving end, the decoder is the person who receives the message and decodes it. E-Communication is very touchy. Many people interpret messages in different ways. For example, Your company sends out an email to all employees, “Do to recent issues, all employees must report to the supervisors when going to lunch. Thank you for your understanding.” Would you take offense? Would you wonder what “recent issues” caused this change? As the decoder, a message can be impetrated several ways. Clear and accurate communication is the key when sending and receiving messages.…

    • 651 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    DBQ Chapter 3

    • 409 Words
    • 2 Pages

    The relationship between the British North Colonies and the government back in England was basically based on religion and politics. The British colonies were under the supervision of the government back home, and because of that, they eventually rebelled.…

    • 409 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    For our course assignment, we will ignore the multidependencies and focus on bringing the design to 3NF. The design is already in 1NF, but not in 2NF, due to the partial dependency InstructorNum → InstructorName. Split the table into two:…

    • 268 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Information Systems

    • 386 Words
    • 2 Pages

    The students and their course names make the tables related. The student ID correlates to the students' last names and first names and the course ID. Therefore, this is the primary key. The course ID is the foreign key of the Course Table.…

    • 386 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Cw Comp1302

    • 935 Words
    • 4 Pages

    - System will record one team as the “Home team” (the team owns the basketball court that will be played on) and the…

    • 935 Words
    • 4 Pages
    Good Essays
  • Good Essays

    ASSIGNMENT 06

    • 886 Words
    • 5 Pages

    a)Using two INSERT statements store in the database the fact that PC model 1100 is made by manufacturer C, has speed 1800, RAM 256, hard disk 80, a 20x DVD, and sells for $2499. !…

    • 886 Words
    • 5 Pages
    Good Essays

Related Topics