Question

In: Computer Science

14.19. Suppose that we have the following requirements for a university database that is used to...

14.19. Suppose that we have the following requirements for a university database
that is used to keep track of students’ transcripts:
a. The university keeps track of each student’s name (Sname), student number (Snum), Social Security number (Ssn), current address (Sc_addr) and phone (Sc_phone), permanent address (Sp_addr) and phone (Sp_phone), birth date (Bdate), sex (Sex), class (Class) (‘freshman’, ‘sophomore’, … , ‘graduate’), major department (Major_code), minor department (Minor_code) (if any), and degree program (Prog) (‘b.a.’, ‘b.s.’, … , ‘ph.d.’). Both Ssn and student number have unique values for each student.
b. Each department is described by a name (Dname), department code (Dcode), office number (Doffice), office phone (Dphone), and college
(Dcollege). Both name and code have unique values for each department.
c. Each course has a course name (Cname), description (Cdesc), cours number (Cnum), number of semester hours (Credit), level (Level), and offering department (Cdept). The course number is unique for each course.

d. Each section has an instructor (Iname), semester (Semester), year (Year), course (Sec_course), and section number (Sec_num). The section number
distinguishes different sections of the same course that are taught during the same semester/year; its values are 1, 2, 3, … , up to the total number of sections taught during each semester.
e. A grade record refers to a student (Ssn), a particular section, and a grade (Grade).
Design a relational database schema for this database application. First show all the functional dependencies that should hold among the attributes. Then design relation schemas for the database that are each in 3NF or BCNF. Specify the key attributes of each relation. Note any unspecified requirements, and make appropriate assumptions to render the specification complete.

Using your DBMS, build this database and populate it with several entities. (Use your imagination)

Using your DBMS, build this database and populate it with several entities. (Use your imagination)

Using your DBMS, build this database and populate it with several entities. (Use your imagination)

Please help me with the set up SQL. thank you

Solutions

Expert Solution

Fuctional dependency is defined as a relationship between the two attributes of same table. FD helps in preventing anomalies and data redundancy.

These are Functional dependencies that can be inferred from given scenario:

Explanation for Functional dependencies

Primary key assumptions:

Primary key of STUDENT - SNUM

Primary key of DEPARTMENT - DEPTCODE

Foreign key assumptions:

STUDENT.MAJOR -> DEPARTMENT.DEPTCODE

STUDENT.MINOR -> DEPARTMENT.DEPTCODE

COURSE.CDEPT -> DEPARTMENT.DEPTCODE

SECTION.SECCOURSE -> COURSE.CNUM

GRADES.(SECCOURSE, SEMESTER, YEAR, SECNUM) -> SECTION.(SECCOURSE, SEMESTER, YEAR, SECNUM)

GRADES.SNUM -> STUDENT.SNUM

Database creation steps:

/* Create a table called student */
CREATE TABLE student(snum int PRIMARY KEY, ssn int unique, sc_addr varchar(50), sc_phone int, sp_addr varchar(50), spp_phone int, b_date int, sex char(10), class char(50), prog char(50), major_code char(20), minor_code char(20));

/* Create a table called department */
CREATE TABLE department(dcode int primary key, Dname char(20) unique, Doffice int, Dphone int, Dcollege char(50));


/* Create a table called course */
CREATE TABLE course ( Cnum int primary key, Cname char(20) unique , Cdesc char(100), credit int, level int, Cdept char(20));


/* Create a table called section */
CREATE TABLE section(sec_course char(20), sec_num int, semester int, year int, instructor_name char(20) );

/* Create a table called grades */
CREATE TABLE grades(sec_course char(20), sec_num int, semester int, year int, grade char(5));

/* Create few records in these table */

INSERT INTO student VALUES('Tom', 1, '101 park avenue', 12345, '102 street',1277, 20-02-1998, 'M', 'Global', 'C++', 'CS01', 'A');

INSERT INTO department VALUES( 101, 'Computer', 18001, 7869, 'Sunshine coast');

INSERT INTO course VALUES( 11, 'management', 'deals with management topics', '50 hours', 1, 'Engineering');

INSERT INTO section VALUES( 'Programming', 2, 4, 2001, 'Harry');

INSERT INTO grades VALUES('Programming', 2, 4, 2001, 'Harry', 'C');


Related Solutions

Consider the following set of requirements for a UNIVERSITY database that is used to keep track...
Consider the following set of requirements for a UNIVERSITY database that is used to keep track of students' transcripts. (a) The university keeps track of each student's name, student number, social security number, current address and phone, permanent address and phone, birthdate, sex, class (freshman, sophomore, ..., graduate), major department, minor department (if any), and degree program (B.A., B.S., ..., Ph.D.). Some user applications need to refer to the city, state, and zip of the student's permanent address, and to...
Consider the following set of requirements for a university information system that is used to keep...
Consider the following set of requirements for a university information system that is used to keep track of students’ transcripts. R1: The university keeps track of each student's name, student number, class, and degree program. R2. The university consists of various departments. Each department is described by a name, department code and phone. R3. Each course has a course number, course name, and credits. R4. Each section has an instructor, course number, and section number. There might be multiple sections...
We have provided you the Hotel database to be used with SQLite DBMS. You should use...
We have provided you the Hotel database to be used with SQLite DBMS. You should use this database in SQLite to extract the necessary information as per the following query requirements. The sqlite script is based on the following relational schema: •Hotel (hotelNo, hotelName, city) • Room (roomNo, hotelNo, type, price) • Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) •Guest (guestNo, guestName, guestAddress) Note the following details of the hotel database; •Hotel contains hotel details and hotelNo is the primary key;...
Check the requirements for confidence intervals using the following information: Suppose we want to estimate the...
Check the requirements for confidence intervals using the following information: Suppose we want to estimate the proportion of American teenagers who would rather own movies physically vs those who would rather own movies digitally. A survey of 45 American teenagers finds that 12 of them would rather own movies physically. With this information, you plan to create a 95% Confidence Interval for the true proportion of Americans who would rather own movies physically. Conditions: i. The method of sampling      ...
Suppose we are interested in the proportion of nursing majors at a university, and we take...
Suppose we are interested in the proportion of nursing majors at a university, and we take a random sample of 150 students to estimate the percent of students in our class who are nursing majors. What is the population? What is the sample? What is the variable? Is the variable qualitative or quantitative?
Consider a university database for the scheduling of classrooms for final exams. This database could be...
Consider a university database for the scheduling of classrooms for final exams. This database could be modeled as the single entity set exam, with attributes course-name, section-number, room-number, and time. Alternatively, one or more additional entity sets could be defined, along with relationship sets to replace some of the attributes of the entity set, as • course with attributes name, department, and c-number • section with attributes s-number and enrollment, and dependent as a weak entity set on course •...
Suppose we have the following CPI figures below:
Suppose we have the following CPI figures below:CPI(Price Level)Year(1982=100)July 2017215July 2018223July 2019236Using the table above, please answer Questions 8a through 8c below:     a. What do these numbers tell you about the price level in these three years? Is there inflation or deflation? Why? Explain.    9b. Calculate the inflation rates for July 2018 and July 2019. Is there inflation or deflation occurring and why? What factors could contribute to inflation or deflation between July 2018 and July 2019?
SQL DATABASE Task 2 [10.5 marks] using the AdditionCollege database For task 2, we have provided...
SQL DATABASE Task 2 [10.5 marks] using the AdditionCollege database For task 2, we have provided you with the creation script for the AdditionCollege database. Run this script in MySQL Workbench to create the database. You should execute your query solutions to extract the necessary information. The script is based on the following schematic: Unit (Unit_code, Staff_id, [UnitName]) Staff (Staff_id, StaffName, Position, Gender) Taught_by (Unit_code, Staff_id, weekday) Student (Student_id, Student_name, Address, Gender) TuteGroup (TuteGroup_code, Unit_code, DayHrCode, Room_Nr) TuteGroup_List (TuteGroup_code, Student_id)...
Suppose we know that at a University XYZ that 15% of students receive an A in...
Suppose we know that at a University XYZ that 15% of students receive an A in their introductory statistics class, 20% receive a B, 30% receive a C, 10% receive a D, and the rest receive an F. For comparison, a sample of 260 students at University ABC is taken and 20% received an A, 25% received a B, 25% received a C, 10% received a D, and the remaining students failed the class. When testing (at the 5% level...
Consider the following description for a university database system, split into numbered sentences for easy reading:
Consider the following description for a university database system, split into numbered sentences for easy reading:(i) The university offers several modules, and students can enroll into one or more modules.(ii) Each module, identified using a unique ID, will involve multiple assignments.(iii) Each assignment will be allocated a number that is unique within that module (but not necessarily across modules).Which entity among those in the description is suitable to be modeled as a WEAK ENTITY SET?A. AssignmentB. ModuleC. StudentsD. University
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT